[Bug] Inconsistency in moveToFront and activate

If you found a bug in our library or on our website, please report it in this section. In this forum you can also make concrete suggestions or feature requests.

Moderators: CEGUI MVP, CEGUI Team

N0vember
Just popping in
Just popping in
Posts: 5
Joined: Fri Dec 24, 2010 04:05

[Bug] Inconsistency in moveToFront and activate

Postby N0vember » Thu May 19, 2011 13:21

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 ?

Jamarr
CEGUI MVP
CEGUI MVP
Posts: 812
Joined: Tue Jun 03, 2008 23:59
Location: USA

Re: Inconsistency in moveToFront and activate

Postby Jamarr » Thu May 19, 2011 19:50

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.
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Inconsistency in moveToFront and activate

Postby CrazyEddie » Sun May 22, 2011 08:49

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.

Woovie
Just popping in
Just popping in
Posts: 3
Joined: Mon Oct 28, 2013 22:49

Re: Inconsistency in moveToFront and activate

Postby Woovie » Mon Oct 28, 2013 23:06

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

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Inconsistency in moveToFront and activate

Postby Ident » Sat Jan 04, 2014 14:59

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+requests

You can still do this if you want.
CrazyEddie: "I don't like GUIs"

Woovie
Just popping in
Just popping in
Posts: 3
Joined: Mon Oct 28, 2013 22:49

Re: [Bug] Inconsistency in moveToFront and activate

Postby Woovie » Tue Apr 15, 2014 16:54

https://bitbucket.org/cegui/cegui/pull- ... antis/diff

I think I did this correctly. If not, sue me.

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: [Bug] Inconsistency in moveToFront and activate

Postby Ident » Tue Apr 15, 2014 17:01

I commented in the code section and to the request itself, please read the comments.
CrazyEddie: "I don't like GUIs"

Woovie
Just popping in
Just popping in
Posts: 3
Joined: Mon Oct 28, 2013 22:49

Re: [Bug] Inconsistency in moveToFront and activate

Postby Woovie » Tue Apr 15, 2014 19:43

Thanks, will do when I have the chance.

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: [Bug] Inconsistency in moveToFront and activate

Postby Ident » Tue Apr 15, 2014 19:58

Thanks a lot.
CrazyEddie: "I don't like GUIs"


Return to “Bug Reports, Suggestions, Feature Requests”

Who is online

Users browsing this forum: No registered users and 17 guests