[Interest] QEventDispatcherGlib: timers don't timeout due to higher priority of socket notifier event dispatching

Danny Smit danny.smit.0 at gmail.com
Fri Sep 18 10:46:53 CEST 2015

> From the description of the symptom and from the fact that the non-glib
> dispatcher behaves differently, it sounds like this behaviour is not intended.
> I'll ask you to file a bug about this. Unfortunately, I can tell you the bug
> will get assigned to me and I have little clue about the workings of the Glib
> dispatcher and I don't know how to fix the issue. Help would be appreciated
> (maybe I'll ask on Google+ if someone who knows glib can advise).

Thanks, I will gather as much detailed information as I can and create
a bug report with it.

One thing that I did find out is that the problem does not occur when
I apply the following patch to the GLIB event dispatcher in Qt:

--- ORG/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp
2015-09-17 16:13:14.726026280 +0200
+++ TEST/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp
2015-09-17 15:19:27.391698360 +0200
@@ -370,7 +339,7 @@ QEventDispatcherGlibPrivate::QEventDispa

     idleTimerSource->timerSource = timerSource;
     g_source_set_can_recurse(&idleTimerSource->source, true);
-    g_source_set_priority(&idleTimerSource->source, G_PRIORITY_DEFAULT_IDLE);
+//    g_source_set_priority(&idleTimerSource->source, G_PRIORITY_DEFAULT_IDLE);
     g_source_attach(&idleTimerSource->source, mainContext);

With this patch the timer event dispatching occurs with the same
priority as other type of events and the GLIB dispatcher seemingly
behaves the same as the UNIX dispatcher.

However I'm no expert at this point and this will probably have
unexpected side effects. Moreover, it makes the whole implementation
of the explicit difference between idle and non-idle event dispatching
in the GLIB dispatcher useless.

I'm not sure if this information helps, but please let me know if
there is anything more that I can do that will help.

Danny Smit

More information about the Interest mailing list