summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qguieventdispatcher_glib.cpp
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2009-12-17 09:20:46 (GMT)
committerBradley T. Hughes <bradley.hughes@nokia.com>2009-12-17 09:20:46 (GMT)
commitbc01bb10da23d0d2308cf02a16947be836bc9a21 (patch)
treed57fe1ac55f21cf5c426e31659d2aca5c895f363 /src/gui/kernel/qguieventdispatcher_glib.cpp
parent11ec7b3694feed8514f9559c7b732ad6217e88c6 (diff)
downloadQt-bc01bb10da23d0d2308cf02a16947be836bc9a21.zip
Qt-bc01bb10da23d0d2308cf02a16947be836bc9a21.tar.gz
Qt-bc01bb10da23d0d2308cf02a16947be836bc9a21.tar.bz2
Avoid timer starvation when handling many X11 events
After commit d0d0fdb8e46351b4ab8492de31e5363ef6662b57, timers are normally run at idle priority. This makes it possible for the X11 handler to starve timers indefinitely. Fix this by enforcing one normal priority pass of the timer source after we have processed all X11 events. This has the added benefit of keeping animation timers smooth and consistent, which is the intention of this change. Reviewed-by: Jens Bache-Wiig
Diffstat (limited to 'src/gui/kernel/qguieventdispatcher_glib.cpp')
-rw-r--r--src/gui/kernel/qguieventdispatcher_glib.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/kernel/qguieventdispatcher_glib.cpp b/src/gui/kernel/qguieventdispatcher_glib.cpp
index f8a638c..a252499 100644
--- a/src/gui/kernel/qguieventdispatcher_glib.cpp
+++ b/src/gui/kernel/qguieventdispatcher_glib.cpp
@@ -152,6 +152,8 @@ static gboolean x11EventSourceDispatch(GSource *s, GSourceFunc callback, gpointe
out:
+ source->d->runTimersOnceWithNormalPriority();
+
if (callback)
callback(user_data);
return true;