MyGUI widget focus not updating

scrawl

13-02-2013 17:29:26

I've found that MyGUI's widget focus is not updating as often as it should. Examples:
- When pressing a key to open a dialog directly under the cursor, it is not possible to press a button until the mouse is moved.
- When new widgets appear underneath the cursor as a result of using the scroll wheel, tooltips will not show up until the mouse is moved.

Currently I am using this "workaround" to inject fake mouse movement every frame, but its a very ugly hack isn't it? Maybe there is a better way?

Also, would you accept a patch that repairs this behaviour by default in MyGUI?


// inject some fake mouse movement to force updating MyGUI's widget states
// this shouldn't do any harm since we're moving back to the original position afterwards
MyGUI::InputManager::getInstance().injectMouseMove( int(mMouseX+1), int(mMouseY+1), mMouseWheel);
MyGUI::InputManager::getInstance().injectMouseMove( int(mMouseX), int(mMouseY), mMouseWheel);