X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/beee38cb41aa2ce4fbe9052bf4f70e1be184b553..ad653fa23069c5d9378247084f03c9a718c3ad62:/src/unix/uiactionx11.cpp?ds=sidebyside diff --git a/src/unix/uiactionx11.cpp b/src/unix/uiactionx11.cpp index 78b9a16e0f..0409135408 100644 --- a/src/unix/uiactionx11.cpp +++ b/src/unix/uiactionx11.cpp @@ -16,6 +16,8 @@ #if wxUSE_UIACTIONSIMULATOR #include "wx/uiaction.h" +#include "wx/event.h" +#include "wx/evtloop.h" #include #include @@ -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; }