From 3d5fb54eda2330d76c11a10c39fc70541eddf4a5 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Wed, 29 Oct 2014 08:44:40 +0100 Subject: Cocoa: Handle Qt::WA_MacAlwaysShowToolWindow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Forward the flag to QWindow by setting the _q_macAlwaysShowToolWindowproperty on the window in QWidgetPrivate::create_sys(). Test for the property when creating the window. Task-number: QTBUG-29816 Done-with: Morten Sørvig Change-Id: Id810dda98d02deb0902192cce1783d8b16b04d04 Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/cocoa/qcocoawindow.mm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/plugins/platforms/cocoa/qcocoawindow.mm') diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index ad6390788a..f536e20b39 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -1400,7 +1400,11 @@ QCocoaNSWindow * QCocoaWindow::createNSWindow() if ((type & Qt::Popup) == Qt::Popup) [window setHasShadow:YES]; - [window setHidesOnDeactivate:(type & Qt::Tool) == Qt::Tool]; + // Qt::Tool windows hide on app deactivation, unless Qt::WA_MacAlwaysShowToolWindow is set. + QVariant showWithoutActivating = QPlatformWindow::window()->property("_q_macAlwaysShowToolWindow"); + bool shouldHideOnDeactivate = ((type & Qt::Tool) == Qt::Tool) && + !(showWithoutActivating.isValid() && showWithoutActivating.toBool()); + [window setHidesOnDeactivate: shouldHideOnDeactivate]; // Make popup windows show on the same desktop as the parent full-screen window. [window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenAuxiliary]; -- cgit v1.2.3