summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoaintegration.mm
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2019-07-17 18:09:47 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2019-07-19 10:56:23 +0200
commitaf683471bde93d1859544e7fd4c0638995b1fd5f (patch)
treedb823aa268c6bf213bc981435834ff9f7510ae0e /src/plugins/platforms/cocoa/qcocoaintegration.mm
parent92563a24534c7579b20be0275cd5d8da9e0cd085 (diff)
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 <volker.hilsheimer@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoaintegration.mm')
-rw-r--r--src/plugins/platforms/cocoa/qcocoaintegration.mm19
1 files changed, 0 insertions, 19 deletions
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 &paramList)
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<QCocoaWindow*>(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()