From 94fc977b2bcb46d7ddc206a83009dcaa7d7532d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 2 Mar 2020 12:51:15 +0100 Subject: macOS: Disable system provided tabbing by default macOS 10.12 introduced automatic window tabbing, where the OS provides tab handling on behalf of the application. The feature defaulted to being on, and the release notes asked applications that had their own tab handling to disable the automatic tab handling explicitly. Qt has its own tab handling, and should therefore disable the automatic handling. We do this on a per NSWindow basis, using the tabbingMode property of the window, instead of the global allowsAutomaticWindowTabbing property on NSWindow, so that individual windows can still opt in to the automatic tab handling. Doing it via the tabbingMode property also ensures that we're not affecting the host application's behavior in a plug-in setting. Ideally Qt's tab handling should read the userTabbingPreference property of NSWindow to pick up the system preference choice of whether to open new windows as standalone windows or tabs, but this is left for a later change. An alternative would also be to use the automatic window tabbing instead of our own implementation. Fixes: QTBUG-61707 Change-Id: Icf2078b63ec16202ff7fd83ea264a48dc61978e1 Reviewed-by: Volker Hilsheimer Reviewed-by: Timur Pocheptsov --- src/plugins/platforms/cocoa/qcocoawindow.mm | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index 9cb4470e02..5edc7223b1 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -1635,6 +1635,7 @@ QCocoaNSWindow *QCocoaWindow::createNSWindow(bool shouldBePanel) nsWindow.restorable = NO; nsWindow.level = windowLevel(flags); + nsWindow.tabbingMode = NSWindowTabbingModeDisallowed; if (shouldBePanel) { // Qt::Tool windows hide on app deactivation, unless Qt::WA_MacAlwaysShowToolWindow is set -- cgit v1.2.3