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
This commit is contained in:
Seth Hillbrand 2018-09-22 19:37:02 -07:00
parent cbce4d7663
commit ae13e441af
1 changed files with 4 additions and 8 deletions

View File

@ -24,10 +24,6 @@
#include <widgets/net_selector.h> #include <widgets/net_selector.h>
#ifdef __WXGTK__
#include <gtk/gtk.h>
#endif
#include <class_board.h> #include <class_board.h>
#include <netinfo.h> #include <netinfo.h>
#include <wx/arrstr.h> #include <wx/arrstr.h>
@ -98,6 +94,7 @@ public:
Show( true ); Show( true );
wxGUIEventLoop eventLoop; wxGUIEventLoop eventLoop;
wxEventLoopActivator activate( &eventLoop );
while ( eventLoop.Pending() ) while ( eventLoop.Pending() )
{ {
@ -132,14 +129,12 @@ public:
CaptureMouse(); CaptureMouse();
} }
#ifdef __WXGTK__
gtk_main_iteration(); // work around stupid assert in wxGUIEventLoop::Dispatch()
#else
eventLoop.Dispatch(); eventLoop.Dispatch();
#endif
if( m_cancelled || m_selected ) if( m_cancelled || m_selected )
break; break;
wxSafeYield( m_parent );
} }
if( HasCapture() ) if( HasCapture() )
@ -263,6 +258,7 @@ NET_SELECTOR::NET_SELECTOR( wxWindow *parent, wxWindowID id,
const wxPoint &pos, const wxSize &size, long style ) : const wxPoint &pos, const wxSize &size, long style ) :
wxComboCtrl( parent, id, wxEmptyString, pos, size, style|wxCB_READONLY ), wxComboCtrl( parent, id, wxEmptyString, pos, size, style|wxCB_READONLY ),
m_netinfoList( nullptr ), m_netinfoList( nullptr ),
m_netcode( -1 ),
m_netSelectorPopup( nullptr ) m_netSelectorPopup( nullptr )
{ } { }