1 --- src/corelib/kernel/qeventdispatcher_glib.cpp.sav 2014-03-28 15:26:37.000000000 +0100
2 +++ src/corelib/kernel/qeventdispatcher_glib.cpp 2014-04-24 09:44:09.358659204 +0200
3 @@ -255,22 +255,30 @@ struct GPostEventSource
5 QAtomicInt serialNumber;
7 + QEventLoop::ProcessEventsFlags processEventsFlags;
8 QEventDispatcherGlibPrivate *d;
11 static gboolean postEventSourcePrepare(GSource *s, gint *timeout)
13 + GPostEventSource *source = reinterpret_cast<GPostEventSource *>(s);
14 QThreadData *data = QThreadData::current();
18 + QEventLoop::ProcessEventsFlags excludeAllFlags
19 + = QEventLoop::ExcludeUserInputEvents
20 + | QEventLoop::ExcludeSocketNotifiers
21 + | QEventLoop::X11ExcludeTimers;
22 + if ((source->processEventsFlags & excludeAllFlags) == excludeAllFlags)
28 const bool canWait = data->canWaitLocked();
29 *timeout = canWait ? -1 : 0;
31 - GPostEventSource *source = reinterpret_cast<GPostEventSource *>(s);
33 || (source->serialNumber != source->lastSerialNumber));
35 @@ -284,8 +292,14 @@ static gboolean postEventSourceDispatch(
37 GPostEventSource *source = reinterpret_cast<GPostEventSource *>(s);
38 source->lastSerialNumber = source->serialNumber;
39 - QCoreApplication::sendPostedEvents();
40 - source->d->runTimersOnceWithNormalPriority();
41 + QEventLoop::ProcessEventsFlags excludeAllFlags
42 + = QEventLoop::ExcludeUserInputEvents
43 + | QEventLoop::ExcludeSocketNotifiers
44 + | QEventLoop::X11ExcludeTimers;
45 + if ((source->processEventsFlags & excludeAllFlags) != excludeAllFlags) {
46 + QCoreApplication::sendPostedEvents();
47 + source->d->runTimersOnceWithNormalPriority();
49 return true; // i dunno, george...
52 @@ -329,6 +343,7 @@ QEventDispatcherGlibPrivate::QEventDispa
53 postEventSource = reinterpret_cast<GPostEventSource *>(g_source_new(&postEventSourceFuncs,
54 sizeof(GPostEventSource)));
55 postEventSource->serialNumber = 1;
56 + postEventSource->processEventsFlags = QEventLoop::AllEvents;
57 postEventSource->d = this;
58 g_source_set_can_recurse(&postEventSource->source, true);
59 g_source_attach(&postEventSource->source, mainContext);
60 @@ -423,6 +438,7 @@ bool QEventDispatcherGlib::processEvents
62 // tell postEventSourcePrepare() and timerSource about any new flags
63 QEventLoop::ProcessEventsFlags savedFlags = d->timerSource->processEventsFlags;
64 + d->postEventSource->processEventsFlags = flags;
65 d->timerSource->processEventsFlags = flags;
66 d->socketNotifierSource->processEventsFlags = flags;
68 @@ -435,6 +451,7 @@ bool QEventDispatcherGlib::processEvents
69 while (!result && canWait)
70 result = g_main_context_iteration(d->mainContext, canWait);
72 + d->postEventSource->processEventsFlags = savedFlags;
73 d->timerSource->processEventsFlags = savedFlags;
74 d->socketNotifierSource->processEventsFlags = savedFlags;
76 --- src/corelib/kernel/qeventdispatcher_unix.cpp.sav 2013-06-07 07:16:52.000000000 +0200
77 +++ src/corelib/kernel/qeventdispatcher_unix.cpp 2014-04-24 09:43:06.927589535 +0200
78 @@ -905,7 +905,15 @@ bool QEventDispatcherUNIX::processEvents
80 // we are awake, broadcast it
82 - QCoreApplicationPrivate::sendPostedEvents(0, 0, d->threadData);
84 + QEventLoop::ProcessEventsFlags excludeAllFlags
85 + = QEventLoop::ExcludeUserInputEvents
86 + | QEventLoop::ExcludeSocketNotifiers
87 + | QEventLoop::X11ExcludeTimers;
88 + if ((flags & excludeAllFlags) == excludeAllFlags)
90 + if(( flags & excludeAllFlags ) != excludeAllFlags )
91 + QCoreApplicationPrivate::sendPostedEvents(0, 0, d->threadData);
94 const bool canWait = (d->threadData->canWaitLocked()