diff options
author | Timur Pocheptsov <Timur.Pocheptsov@digia.com> | 2015-02-17 17:19:42 +0100 |
---|---|---|
committer | Timur Pocheptsov <Timur.Pocheptsov@digia.com> | 2015-03-09 08:34:27 +0000 |
commit | 5bf9528b9164bd888e991552b66d6237e84a7ee2 (patch) | |
tree | 741d257fc84f286d3c24cec3536717c0fafa54f5 /src/plugins | |
parent | 14fdd946f6260b239ee4215910f87fc2908b8fee (diff) |
Revert "OS X: main window doesn't become key."
This reverts commit da0c74550f0e8a21239896d6aead6e05f85eb695.
The patch da0c74 unfortunately does not work well with QCocoaMenuBar's logic:
it can happen that our selectNextKeyWindow chooses a Popup or another window with
some 'unusual' flag as a key, but QCocoaMenuBar::updateMenuBarImmediately will return
immediately, assuming that popup does not have a menu and there are no menu items to enable.
Task-number: QTBUG-44369
Change-Id: I83cd2f6a62acd3a6ceb4d9dbf53ca42af67476d8
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoawindow.mm | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index 6656212457..2adea0f493 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -82,31 +82,6 @@ static bool isMouseEvent(NSEvent *ev) } } -static void selectNextKeyWindow(NSWindow *currentKeyWindow) -{ - if (!currentKeyWindow) - return; - - const QCocoaAutoReleasePool pool; - - if ([[NSApplication sharedApplication] keyWindow] != currentKeyWindow) - return;//currentKeyWindow is not a key window actually. - - NSArray *const windows = [[NSApplication sharedApplication] windows]; - bool startLookup = false; - for (NSWindow *candidate in [windows reverseObjectEnumerator]) { - if (!startLookup) { - if (candidate == currentKeyWindow) - startLookup = true; - } else { - if ([candidate isVisible] && [candidate canBecomeKeyWindow]) { - [candidate makeKeyWindow]; - break; - } - } - } -} - @implementation QNSWindowHelper @synthesize window = _window; @@ -599,9 +574,6 @@ void QCocoaWindow::hide(bool becauseOfAncestor) foreach (QCocoaWindow *childWindow, m_childWindows) childWindow->hide(true); - if (window()->transientParent() && m_nsWindow == [[NSApplication sharedApplication] keyWindow]) - selectNextKeyWindow(m_nsWindow); // Otherwise, Cocoa can do it wrong. - [m_nsWindow orderOut:nil]; } |