diff options
author | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2010-01-25 14:22:11 (GMT) |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2010-01-25 14:26:32 (GMT) |
commit | 8cdab74082019c0b8a57883a11aa5093a644abdd (patch) | |
tree | 70ca1fceed8175653a12a01f30be713a751aa274 /src/gui/kernel | |
parent | f405a89621b4bfe957d7e0e4d321a9ea0931d34b (diff) | |
download | Qt-8cdab74082019c0b8a57883a11aa5093a644abdd.zip Qt-8cdab74082019c0b8a57883a11aa5093a644abdd.tar.gz Qt-8cdab74082019c0b8a57883a11aa5093a644abdd.tar.bz2 |
Qt/Cocoa Event Dispatcher Problem in modal dialogs
The problem is that we didn't check if the event dispatcher was
interrupted before starting to wait for more events. This patch will do
the interrupt test after processing modal session events, and just
before starting to wait. This will fix applications that expects e.g an
event loop to exit immidiatly upon a signal from a timer (without the
need for the user to generate e.g. a mouse event to stop the wait).
Task-number: QTBUG-7503
Reviewed-by: cduclos
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qeventdispatcher_mac.mm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/kernel/qeventdispatcher_mac.mm b/src/gui/kernel/qeventdispatcher_mac.mm index eda75db..c7c7caf 100644 --- a/src/gui/kernel/qeventdispatcher_mac.mm +++ b/src/gui/kernel/qeventdispatcher_mac.mm @@ -569,7 +569,7 @@ bool QEventDispatcherMac::processEvents(QEventLoop::ProcessEventsFlags flags) // in cocoa. [NSApp run] should be called at least once for any cocoa app. if (NSModalSession session = d->currentModalSession()) { QBoolBlocker execGuard(d->currentExecIsNSAppRun, false); - while (!d->interrupt && [NSApp runModalSession:session] == NSRunContinuesResponse) + while ([NSApp runModalSession:session] == NSRunContinuesResponse && !d->interrupt) qt_mac_waitForMoreModalSessionEvents(); if (!d->interrupt && session == d->currentModalSessionCached) { // INVARIANT: Someone called e.g. [NSApp stopModal:] from outside the event |