X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b5b208a1796ecf1b9ab267d200705b4f3b4d10e3..3eee64e7cfbf7741766bee8f7e612045dd8a3ad0:/src/unix/uiactionx11.cpp?ds=sidebyside diff --git a/src/unix/uiactionx11.cpp b/src/unix/uiactionx11.cpp index 84d44f4a68..a19a3d2284 100644 --- a/src/unix/uiactionx11.cpp +++ b/src/unix/uiactionx11.cpp @@ -4,7 +4,6 @@ // Author: Kevin Ollivier, Steven Lamerton, Vadim Zeitlin // Modified by: // Created: 2010-03-06 -// RCS-ID: $Id$ // Copyright: (c) Kevin Ollivier // (c) 2010 Steven Lamerton // (c) 2010 Vadim Zeitlin @@ -16,7 +15,10 @@ #if wxUSE_UIACTIONSIMULATOR #include "wx/uiaction.h" +#include "wx/event.h" +#include "wx/evtloop.h" +#include #include #include "wx/unix/utilsx11.h" @@ -87,6 +89,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; }