injectMouseButtonDown returns always true

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

wolfmanfx
Just popping in
Just popping in
Posts: 4
Joined: Sun Feb 14, 2010 19:19

injectMouseButtonDown returns always true

Postby wolfmanfx » Sun Mar 07, 2010 21:39

Hi,
I updated to CeGUI 0.7.1 and realized that injectMouseButtonDown (and all other inject methods) returns true.

The problem is in CeGUISystem.cpp line 1022 in function getTargetWindow

Code: Select all

       
if (!dest_window)
            return 0;//dest_window = d_activeSheet;

After making the change above everything works like excepted.

wolfmanfx
Just popping in
Just popping in
Posts: 4
Joined: Sun Feb 14, 2010 19:19

Re: injectMouseButtonDown returns always true

Postby wolfmanfx » Sun Mar 07, 2010 22:22

mmm this has also some side effects like window resizing do not work and the mousecursor disappear when hover over an editbox.

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

Re: injectMouseButtonDown returns always true

Postby CrazyEddie » Mon Mar 08, 2010 08:03

Returning the set GUI sheet as the default / catch-all target window is something we've always done.

I imagine the issue is related to changes that were made to the way the inject functions work; in 0.6.x the return values from these functions - especially the mouse related functions - were largely worthless, and required app side kludges to be able to reliably detect whether a mouse event occurred over a UI window or not - where the full screen root window is not considered as UI.

I fixed this for 0.7.x such that all mouse events are marked handled (and thus, the inject function will return true) except in the case of a root window of type DefaultWindow (class GUISheet) with the MousePassThroughEnabled property set to true - in these cases, the inject function will only return true if a subscribed event handler marked the input as handled.

So the solution should be to ensure you have a DefaultWindow as the root of the layout and set the MousePassThroughEnabled property to True.

HTH

CE


Return to “Bug Reports, Suggestions, Feature Requests”

Who is online

Users browsing this forum: No registered users and 8 guests