winrt: Fixed timer handling in case where additional user events occur

When timers are used in connection with widgets, it is possible that
additional events occur (e.g. deferred deletions). If these happen, the
event dispatcher also has to handle timers after handling these events
as timer events might not be handled at all otherwise. So instead of
returning early, we check whether timer events happened and might
return afterwards.

Task-number: QTBUG-46299
Change-Id: I3ef0fb23b3ae9a1e13e42497bcfb0976cf4e1b91
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
bb10
Oliver Wolff 2015-05-26 14:03:11 +02:00
parent ad9698713f
commit a42330dc12
1 changed files with 6 additions and 3 deletions

View File

@ -203,9 +203,9 @@ bool QEventDispatcherWinRT::processEvents(QEventLoop::ProcessEventsFlags flags)
}
}
// Dispatch accumulated user events
if (sendPostedEvents(flags))
return true;
// Additional user events have to be handled before timer events, but the function may not
// return yet.
const bool userEventsSent = sendPostedEvents(flags);
emit aboutToBlock();
const QVector<HANDLE> timerHandles = d->timerIdToHandle.values().toVector();
@ -228,6 +228,9 @@ bool QEventDispatcherWinRT::processEvents(QEventLoop::ProcessEventsFlags flags)
return true;
}
emit awake();
if (userEventsSent)
return true;
} while (flags & QEventLoop::WaitForMoreEvents);
return false;
}