Minor optimization in wxGTK wxYield()

Don't call gdk_window_get_display() if we don't need it because we don't have
any events to put back into the display queue.
This commit is contained in:
Vadim Zeitlin 2016-06-05 00:55:20 +02:00
parent 1a438e786c
commit cc37031d46

View File

@ -385,7 +385,9 @@ void wxGUIEventLoop::DoYieldFor(long eventsToProcess)
wxEventLoopBase::DoYieldFor(eventsToProcess);
// put all unprocessed GDK events back in the queue
// put any unprocessed GDK events back in the queue
if ( !m_arrGdkEvents.IsEmpty() )
{
GdkDisplay* disp = gdk_window_get_display(wxGetTopLevelGDK());
for (size_t i=0; i<m_arrGdkEvents.GetCount(); i++)
{
@ -397,4 +399,5 @@ void wxGUIEventLoop::DoYieldFor(long eventsToProcess)
}
m_arrGdkEvents.Clear();
}
}