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
parent
ad9698713f
commit
a42330dc12
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue