(1)
In my app I have code like this:
Code: Select all
bool control::mousePressed( const OIS::MouseEvent &evt, OIS::MouseButtonID id )
{
if (CEGUI::System::getSingleton().injectMouseButtonDown(convertButton(id))) return true;
// ... rest of the code ...
mouseDown = true;
The way that works is if the user clicks on a Cegui window, Cegui will notice, do something (or not, depending on what part of the window they clicked on) and return true, indicating it handled the click, one way or another. When that happens, that if statement will evaluate true, thus making the code "return true" execute, leaving the mousePressed function. But if the user doesn't click on a Cegui window, then the "rest of the code" in mousePressed will execute.
What I'm finding, however, is that in Cegui 0.6.2 if I click on a button repeatedly, and a little fast, some of the clicks don't get handled by Cegui and go straight through. So even though I'm clicking on a Cegui button, that variable "mouseDown" will get set to true. (And I've subscribed to both MouseClick and MouseDoubleClick events.) What's more is that even though the mouse pressed event was not handled, the mouse released event always seems to get triggered. The mouse release function has a similar structure, where if Cegui handles the mouse release event, then it returns and the rest of the function doesn't execute.
So in this example, what can happen is a user rapidly clicks on a button, Cegui fails to handle the mouse press event, so the rest of the function executes and mouseDown gets set to true. However the mouse release event is handled, so mouseDown never gets set back to false. And bam, the mouse is now stuck down.
Yes, there are some workarounds that are currently in place, but they kinda break the rule I'm using that only one system will handle a particular event like a mouse click.
(2)
In CELE2, I made a frame with no title bar that just holds buttons. In 0.7.5, if I click on an empty space in that frame, like in between two buttons, the Cegeui injectMouseButtonDown still returns true, as it should (even though there is no subscribed event for clicking on the frame, I did still click on the frame, as opposed to somewhere in Ogre's 3D environment). In 0.6.2, however, it returns false, so using the example from above, even though I clicked on the frame, the rest of the code in the mousePressed function will be executed.
To make sure, in code I have explicitly set MousePassThroughEnabled to false. I even tried subscribing to mouse click events for when I click on the frame. And the events work! But the injectMouseButtonDown still returns false, causing the rest of the code in the mousePressed function to execute.
Now this problem doesn't happen with the buttons in this frame (aside from the problems described above in (1)). One difference between the buttons and the frame is this: I make the root sheet manually in code and then just attach the various windows I bring in from different .layout files. So when I created a new layout in CELE2 it asked if I wanted to start with an initial root window and I said no. Could that have something to do with it? Is there something about how I'm bringing these windows into Ogre that I'm doing wrong?