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:
@@ -385,7 +385,9 @@ void wxGUIEventLoop::DoYieldFor(long eventsToProcess)
|
|||||||
|
|
||||||
wxEventLoopBase::DoYieldFor(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());
|
GdkDisplay* disp = gdk_window_get_display(wxGetTopLevelGDK());
|
||||||
for (size_t i=0; i<m_arrGdkEvents.GetCount(); i++)
|
for (size_t i=0; i<m_arrGdkEvents.GetCount(); i++)
|
||||||
{
|
{
|
||||||
@@ -398,3 +400,4 @@ void wxGUIEventLoop::DoYieldFor(long eventsToProcess)
|
|||||||
|
|
||||||
m_arrGdkEvents.Clear();
|
m_arrGdkEvents.Clear();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user