From 6530886d3137cb8072be8f8b4557a277ff1c6183 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 12 Oct 2019 17:27:05 +0200 Subject: [PATCH] Call XFlush() after simulating key press in wxGTK This makes simulating keys much more reliable, previously they were just completely lost (i.e. never resulted in key-press-event signal being generated by GTK) sometimes. --- 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 96fe8c0629..4722aff96b 100644 --- a/src/unix/uiactionx11.cpp +++ b/src/unix/uiactionx11.cpp @@ -341,7 +341,12 @@ bool wxUIActionSimulatorX11Impl::DoKey(int keycode, int modifiers, bool isDown) if ( xkeycode == NoSymbol ) return false; - return DoX11Key(xkeycode, modifiers, isDown); + if ( !DoX11Key(xkeycode, modifiers, isDown) ) + return false; + + XFlush(m_display); + + return true; } wxUIActionSimulator::wxUIActionSimulator()