diff --git a/src/unix/uiactionx11.cpp b/src/unix/uiactionx11.cpp index e8b47f7579..50c525b333 100644 --- a/src/unix/uiactionx11.cpp +++ b/src/unix/uiactionx11.cpp @@ -106,6 +106,10 @@ bool wxUIActionSimulatorX11Impl::SendButtonEvent(int button, bool isDown) return false; } + // Ensure that the event is received by the correct window by processing + // all pending events, notably mouse moves. + XSync(m_display, False /* don't discard */); + return DoX11Button(xbutton, isDown); }