From f65133a41f2d494f6535d20b26cbc1105ec0fd47 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 15 Oct 2019 00:07:38 +0200 Subject: [PATCH] Call XFlush() after simulating mouse button events too For some reason, mouse press events were still received without flushing, but mouse release ones were not received by GTK itself (and a fortiori by wxGTK) without it. --- src/unix/uiactionx11.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/unix/uiactionx11.cpp b/src/unix/uiactionx11.cpp index 6ea7f5ce63..8d72835868 100644 --- a/src/unix/uiactionx11.cpp +++ b/src/unix/uiactionx11.cpp @@ -108,7 +108,12 @@ bool wxUIActionSimulatorX11Impl::SendButtonEvent(int button, bool isDown) // all pending events, notably mouse moves. XSync(m_display, False /* don't discard */); - return DoX11Button(xbutton, isDown); + if ( !DoX11Button(xbutton, isDown) ) + return false; + + XFlush(m_display); + + return true; } #if wxUSE_PLAINX_IMPL