injectMouseButtonDown returns always true
Posted: Sun Mar 07, 2010 21:39
by wolfmanfx
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.
Re: injectMouseButtonDown returns always true
Posted: Sun Mar 07, 2010 22:22
by wolfmanfx
mmm this has also some side effects like window resizing do not work and the mousecursor disappear when hover over an editbox.
Re: injectMouseButtonDown returns always true
Posted: Mon Mar 08, 2010 08:03
by CrazyEddie
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