From af683471bde93d1859544e7fd4c0638995b1fd5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 17 Jul 2019 18:09:47 +0200 Subject: macOS: Add QCocoaWindowManager for dealing with window levels Moves and improves the logic for lowering splash screens to a dedicated window manager, which will learn more tricks in patches to come. Change-Id: I8b8fd1dd78fdaf6f106a59c84d2a59254f3539c3 Reviewed-by: Volker Hilsheimer Reviewed-by: Timur Pocheptsov --- src/plugins/platforms/cocoa/qcocoaintegration.mm | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'src/plugins/platforms/cocoa/qcocoaintegration.mm') diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm index dd2d1ba0f1..1eed6b5582 100644 --- a/src/plugins/platforms/cocoa/qcocoaintegration.mm +++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm @@ -217,25 +217,6 @@ QCocoaIntegration::QCocoaIntegration(const QStringList ¶mList) connect(qGuiApp, &QGuiApplication::focusWindowChanged, this, &QCocoaIntegration::focusWindowChanged); - - static auto splashScreenHider = QMacKeyValueObserver(NSApp, @"modalWindow", []{ - const QWindowList allWindows = QGuiApplication::topLevelWindows(); - for (QWindow *window : allWindows) { - if ((window->flags() & Qt::SplashScreen) == Qt::SplashScreen) { - QCocoaWindow *platformWindow = static_cast(window->handle()); - NSWindow *splashWindow = platformWindow->view().window; - if (!splashWindow) - continue; - if (NSApp.modalWindow) { - NSInteger originalLevel = splashWindow.level; - splashWindow.level = NSNormalWindowLevel; - window->setProperty("_q_levelBeforeModalSession", (qlonglong)originalLevel); - } else if (NSInteger originalLevel = window->property("_q_levelBeforeModalSession").toLongLong()) { - splashWindow.level = originalLevel; - } - } - } - }); } QCocoaIntegration::~QCocoaIntegration() -- cgit v1.2.3