From ae13e441afa265c8f1590f2be5bdc6cae649548e Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Sat, 22 Sep 2018 19:37:02 -0700 Subject: [PATCH] pcbnew: Yield in GTK for redraw GTK uses a level of cooperative multitasking when dealing with secondary event loops. This gives the wm enough leeway to process the redraw before returning to the secondary loop --- common/widgets/net_selector.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/common/widgets/net_selector.cpp b/common/widgets/net_selector.cpp index 30e828e4bd..bd0ce3d1c5 100644 --- a/common/widgets/net_selector.cpp +++ b/common/widgets/net_selector.cpp @@ -24,10 +24,6 @@ #include -#ifdef __WXGTK__ -#include -#endif - #include #include #include @@ -98,6 +94,7 @@ public: Show( true ); wxGUIEventLoop eventLoop; + wxEventLoopActivator activate( &eventLoop ); while ( eventLoop.Pending() ) { @@ -132,14 +129,12 @@ public: CaptureMouse(); } -#ifdef __WXGTK__ - gtk_main_iteration(); // work around stupid assert in wxGUIEventLoop::Dispatch() -#else eventLoop.Dispatch(); -#endif if( m_cancelled || m_selected ) break; + + wxSafeYield( m_parent ); } if( HasCapture() ) @@ -263,6 +258,7 @@ NET_SELECTOR::NET_SELECTOR( wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, long style ) : wxComboCtrl( parent, id, wxEmptyString, pos, size, style|wxCB_READONLY ), m_netinfoList( nullptr ), + m_netcode( -1 ), m_netSelectorPopup( nullptr ) { }