summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTimur Pocheptsov <timur.pocheptsov@theqtcompany.com>2016-04-29 18:07:36 +0200
committerTimur Pocheptsov <timur.pocheptsov@theqtcompany.com>2016-05-10 19:06:58 +0000
commitab3a8443faa36799ab8142e48d25d8ff10f9d0bf (patch)
tree5a10cc53d15b63347088aa853b5240ba083efc74 /src
parentce37467acf34edf1380f896a0942b616dc4cbead (diff)
QCocoaWindow - do not call resignKeyWindow
QCocoaWindow::setMouseGrabEnabled/setKeyboardGrabEnabled calls resignKeyWindow. According to Apple's docs, we should _never_ call this function (it's done by Cocoa automatically). Calling this function leaves a window in weird state where it can not become key again until you explicitly make another window key first. Task-number: QTBUG-53050 Change-Id: I7a887659df8df11880328ffa2adc07c4a3af63e6 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index dd67946a27..c5519995b6 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -1135,8 +1135,7 @@ bool QCocoaWindow::setKeyboardGrabEnabled(bool grab)
if (grab && ![m_nsWindow isKeyWindow])
[m_nsWindow makeKeyWindow];
- else if (!grab && [m_nsWindow isKeyWindow])
- [m_nsWindow resignKeyWindow];
+
return true;
}
@@ -1147,8 +1146,7 @@ bool QCocoaWindow::setMouseGrabEnabled(bool grab)
if (grab && ![m_nsWindow isKeyWindow])
[m_nsWindow makeKeyWindow];
- else if (!grab && [m_nsWindow isKeyWindow])
- [m_nsWindow resignKeyWindow];
+
return true;
}