Page 1 of 1
[Bug] Inconsistency in moveToFront and activate
Posted: Thu May 19, 2011 13:21
by N0vember
I've discovered a sad side-effect of the way moveToFront() and activate() are implemented :
moveToFront() activates the window, and activate() does it too, whereas the name of the former lead to think it's the correct way of bringing a window to the front without activating it
So i've come to wonder if there should'nt be a method to do just this ? Moving the window to the top of the Z-order without any input handling alteration ?
Re: Inconsistency in moveToFront and activate
Posted: Thu May 19, 2011 19:50
by Jamarr
I looked at the trunk code (v0.7.5+) and these two actions are pretty coupled at the moment: activate() merely releases input-capture from the currently active window and then calls moveToFront(), and moveToFront() handles both the movement and the activation. Their separation would be useful in situations where say an alert window appears on top of all other windows, without taking input-focus from the current window, and then hides itself automatically; there are of course other scenarios where this behavior is warranted.
The bottom line is that the current behavior is not intuitive at all: a function should /only/ perform the action its name implies. I think that fixing these functions in and of themselves would be trivial, but there may be other code incorrectly assuming and relying on the non-intuitive behavior (eg activating calls moveToFront and vice-verse). Hopefully CE or Kulik will be able to resolve this, but if you need this fixed right away feel free to fix this in CEGUI and submit a patch yourself

p.s. For future reference, please make sure to include to version of CEGUI you are using since different versions can have different behaviors.
Re: Inconsistency in moveToFront and activate
Posted: Sun May 22, 2011 08:49
by CrazyEddie
If someone wants to submit this to mantis that would be great[1].
Btw, there was a time in the far distant past when the active window was always whichever window was at the top of the z-order, which is where this originates from

CE.
[1] I am going to do such chores myself much less, and just prod people in the right direction instead - in this way hopefully people will get a bit more hands-on.
Re: Inconsistency in moveToFront and activate
Posted: Mon Oct 28, 2013 23:06
by Woovie
This appears to have never been fixed. Having this issue on a project currently. Bumping for the sake of visibility, but I'll report it on Mantis myself.
Edit:
http://cegui.org.uk/mantis/view.php?id=1001
Re: Inconsistency in moveToFront and activate
Posted: Sat Jan 04, 2014 14:59
by Ident
Thanks for your bug report.
To speed up merging of such bugs you can fork CEGUI and commit your changes and generate a merge request for us as described here:
https://confluence.atlassian.com/displa ... l+requestsYou can still do this if you want.
Re: [Bug] Inconsistency in moveToFront and activate
Posted: Tue Apr 15, 2014 16:54
by Woovie
Re: [Bug] Inconsistency in moveToFront and activate
Posted: Tue Apr 15, 2014 17:01
by Ident
I commented in the code section and to the request itself, please read the comments.
Re: [Bug] Inconsistency in moveToFront and activate
Posted: Tue Apr 15, 2014 19:43
by Woovie
Thanks, will do when I have the chance.
Re: [Bug] Inconsistency in moveToFront and activate
Posted: Tue Apr 15, 2014 19:58
by Ident
Thanks a lot.