Avoid forcing wxYield() after wxUIActionSimulator::MouseMove() in wxGTK.

Yield (for input events only) inside this function itself instead of forcing
all the code using this function to call wxYield() after it as otherwise the
mouse position change is not taken into account by the subsequent simulated
events.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74328 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2013-07-02 20:23:58 +00:00
parent ec34e73ca9
commit bdbdb4d181

View File

@ -16,6 +16,8 @@
#if wxUSE_UIACTIONSIMULATOR
#include "wx/uiaction.h"
#include "wx/event.h"
#include "wx/evtloop.h"
#include <X11/Xlib.h>
#include <X11/Xutil.h>
@ -88,6 +90,15 @@ bool wxUIActionSimulator::MouseMove(long x, long y)
Window root = display.DefaultRoot();
XWarpPointer(display, None, root, 0, 0, 0, 0, x, y);
// At least with wxGTK we must always process the pending events before the
// mouse position change really takes effect, so just do it from here
// instead of forcing the client code using this function to always use
// wxYield() which is unnecessary under the other platforms.
if ( wxEventLoopBase* const loop = wxEventLoop::GetActive() )
{
loop->YieldFor(wxEVT_CATEGORY_USER_INPUT);
}
return true;
}