diff options
author | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2009-12-09 14:30:10 (GMT) |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2009-12-22 14:09:29 (GMT) |
commit | 464306df827cbf3378f72f9aead0448a32ab5a21 (patch) | |
tree | abe5dfae26a3f46dea649e771ab060c5e26ac8b3 /src/gui/kernel/qeventdispatcher_mac_p.h | |
parent | 875afab977005b03d307040fb3be15c7524a37ff (diff) | |
download | Qt-464306df827cbf3378f72f9aead0448a32ab5a21.zip Qt-464306df827cbf3378f72f9aead0448a32ab5a21.tar.gz Qt-464306df827cbf3378f72f9aead0448a32ab5a21.tar.bz2 |
Cocoa: event dispatcher drops events on the floor
Under some circumstances, the event dispatcher needs to stop
NSApplication, let the control return back to the QEventLoop that
called processEvents, which very often will just call processEvents
again, which in turn will restart NSApplication.
After stopping NSApplication, Cocoa seems to throw away at least some
of the posted cocoa events that are still pending. This will offcourse
have inpact on things like window updates etc. that never happends.
This patch will be more careful about when to stop NSApplication, and
delay this until the run loop has finished one more spin after interrupt
has been called. The same goes for modal sessions. Introducing this delay
also made it neccessary to sometimes block cocoa from updating the
stacking order of the windows.
Autotest: qcoreapplication, qapplication, qtimer
Diffstat (limited to 'src/gui/kernel/qeventdispatcher_mac_p.h')
-rw-r--r-- | src/gui/kernel/qeventdispatcher_mac_p.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gui/kernel/qeventdispatcher_mac_p.h b/src/gui/kernel/qeventdispatcher_mac_p.h index dfcb91f..37ee2b1 100644 --- a/src/gui/kernel/qeventdispatcher_mac_p.h +++ b/src/gui/kernel/qeventdispatcher_mac_p.h @@ -174,13 +174,17 @@ public: static QStack<QCocoaModalSessionInfo> cocoaModalSessionStack; static bool currentExecIsNSAppRun; static bool nsAppRunCalledByQt; + static bool cleanupModalSessionsNeeded; + static bool modalSessionsTemporarilyStopped; static NSModalSession currentModalSessionCached; - static void updateChildrenWorksWhenModal(); static NSModalSession currentModalSession(); - static int activeModalSessionCount(); + static void updateChildrenWorksWhenModal(); static void temporarilyStopAllModalSessions(); static void beginModalSession(QWidget *widget); static void endModalSession(QWidget *widget); + static void cancelWaitForMoreEvents(); + static void cleanupModalSessions(); + static void flushCocoaEvents(); #endif MacSocketHash macSockets; @@ -211,6 +215,7 @@ class QtMacInterruptDispatcherHelp : public QObject public: static void interruptLater(); + static void cancelInterruptLater(); }; #endif |