From bdbdb4d18173951919a62187754af26665e8c677 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 2 Jul 2013 20:23:58 +0000 Subject: [PATCH 1/1] 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 --- src/unix/uiactionx11.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) 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; } -- 2.45.2