From 709617eec22a43c8c89aceb5cc4129e985bba2b9 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 23 Oct 2012 12:02:47 +0000 Subject: [PATCH] Process pending events from wxYield() in wxGTK. Calling wxYield() is supposed to process the pending events but it didn't, any more, in wxGTK. Restore this by explicitly calling ProcessPendingEvents() from wxGTK wxYield() implementation as wxGUIEventLoop::ProcessIdle() does not call it, in spite of a comment to the contrary in the sources. Closes #14760. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72723 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/evtloop.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gtk/evtloop.cpp b/src/gtk/evtloop.cpp index c58b0b1c47..cc118104d5 100644 --- a/src/gtk/evtloop.cpp +++ b/src/gtk/evtloop.cpp @@ -355,6 +355,11 @@ bool wxGUIEventLoop::YieldFor(long eventsToProcess) gtk_main_iteration(); gdk_event_handler_set ((GdkEventFunc)gtk_main_do_event, NULL, NULL); + // Process all pending events too, this is consistent with wxMSW behaviour + // and the behaviour of wxGTK itself in the previous versions. + if ( wxTheApp ) + wxTheApp->ProcessPendingEvents(); + if (eventsToProcess != wxEVT_CATEGORY_CLIPBOARD) { // It's necessary to call ProcessIdle() to update the frames sizes which @@ -363,7 +368,7 @@ bool wxGUIEventLoop::YieldFor(long eventsToProcess) // call ProcessIdle() only once since this is not meant for longish // background jobs (controlled by wxIdleEvent::RequestMore() and the // return value of Processidle(). - ProcessIdle(); // ProcessIdle() also calls ProcessPendingEvents() + ProcessIdle(); } //else: if we are inside ~wxClipboardSync() and we call ProcessIdle() and // the user app contains an UI update handler which calls wxClipboard::IsSupported, -- 2.45.2