diff options
author | Morten Johan Sorvig <morten.sorvig@nokia.com> | 2012-03-20 08:32:55 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-20 14:11:06 +0100 |
commit | 10537187b978df899a20e9997b859c60841bb5cc (patch) | |
tree | 52cd953c10ce5c22088d05b8246bd38b35d56568 /src | |
parent | fcc01e6c3736991db2191c151111f03016d2d80b (diff) |
Cocoa: Panels can become key windows too.
The cocoa plugin uses NSPanel instead of NSWindow
for popup-type windows. With the exception of tooltips
and splash screens these windows should take input
focus as well.
Change-Id: Icdf0854e7c511ccc106e035dae4763ae90c23aa5
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoawindow.mm | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index d4327405cb..a76830f0b8 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -83,7 +83,12 @@ - (BOOL)canBecomeKeyWindow { - return NO; + // Most panels can be come the key window. Exceptions are: + if (m_cocoaPlatformWindow->window()->windowType() == Qt::ToolTip) + return NO; + if (m_cocoaPlatformWindow->window()->windowType() == Qt::SplashScreen) + return NO; + return YES; } @end @@ -357,6 +362,7 @@ NSWindow * QCocoaWindow::createNSWindow() defer:NO]; // Deferring window creation breaks OpenGL (the GL context is set up // before the window is shown and needs a proper window.). [window setHasShadow:YES]; + window->m_cocoaPlatformWindow = this; createdWindow = window; } else { styleMask = (NSResizableWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSTitledWindowMask); |