summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qeventdispatcher_mac.mm
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@nokia.com>2011-01-06 08:44:22 (GMT)
committerRichard Moe Gustavsen <richard.gustavsen@nokia.com>2011-01-06 09:35:56 (GMT)
commit48fdd3facb4d67b29452281c2d43577a2f0cdac3 (patch)
tree3395fb94e4437dce133c81a45fe3942304aa6e84 /src/gui/kernel/qeventdispatcher_mac.mm
parent09d2b70f8a23b6c7809117a3c3a77f1ad188957b (diff)
downloadQt-48fdd3facb4d67b29452281c2d43577a2f0cdac3.zip
Qt-48fdd3facb4d67b29452281c2d43577a2f0cdac3.tar.gz
Qt-48fdd3facb4d67b29452281c2d43577a2f0cdac3.tar.bz2
Cocoa: add support for QEventLoop::ExcludeUserInputEvents
Seems like this was just missing when used together with the DialogExec/EventLoopExec flags. This patch avoid using cocoas own run methods for dispatching events when we want to exclude user input events, and instead do it ourselves. This patch will only fix this issue when no modal windows are showing. For modal windows, a bit more research is needed.
Diffstat (limited to 'src/gui/kernel/qeventdispatcher_mac.mm')
-rw-r--r--src/gui/kernel/qeventdispatcher_mac.mm5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/kernel/qeventdispatcher_mac.mm b/src/gui/kernel/qeventdispatcher_mac.mm
index dc926e0..62c22a5 100644
--- a/src/gui/kernel/qeventdispatcher_mac.mm
+++ b/src/gui/kernel/qeventdispatcher_mac.mm
@@ -588,7 +588,10 @@ bool QEventDispatcherMac::processEvents(QEventLoop::ProcessEventsFlags flags)
// manually (rather than from a QEventLoop), we cannot enter a tight
// loop and block this call, but instead we need to return after one flush:
const bool canExec_3rdParty = d->nsAppRunCalledByQt || ![NSApp isRunning];
- const bool canExec_Qt = flags & QEventLoop::DialogExec || flags & QEventLoop::EventLoopExec;
+ const bool canExec_Qt =
+ (flags & QEventLoop::DialogExec || flags & QEventLoop::EventLoopExec)
+ && !(flags & QEventLoop::ExcludeUserInputEvents);
+
if (canExec_Qt && canExec_3rdParty) {
// We can use exec-mode, meaning that we can stay in a tight loop until