diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2023-03-07 12:27:33 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2023-03-08 01:22:19 +0100 |
commit | d7e2c9acf2d84edf8993c81b22a9b4d231aab4ed (patch) | |
tree | cb24092f7b33f390a4ac5815c7b3589d035eb8a4 /src/plugins/platforms/cocoa | |
parent | 4ec5c0efc756a39162b43367438fee965c229ae7 (diff) |
macOS: Don't set opacity on non-top level windows during NSWindow creation
The opacity is a property of NSWindow.
There's no point in pulling out the opacity from QWindowPrivate,
as QWindow has a public accessor for it. And we don't need to
guard the call with a check for non-1.0 opacity. If we want
logic to avoid redundant calls to the platform APIs, they
should be in the setter.
Pick-to: 6.5
Change-Id: Ic9b8d1051f30d3b7e09dae14b9f22ca899d05865
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoawindow.mm | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index cb813114ef..f3a0cadd52 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -1524,16 +1524,13 @@ void QCocoaWindow::recreateWindowIfNeeded() setWindowTitle(window()->title()); setWindowFilePath(window()->filePath()); // Also sets window icon setWindowState(window()->windowState()); + setOpacity(window()->opacity()); } else { // Child windows have no NSWindow, re-parent to superview instead [parentCocoaWindow->m_view addSubview:m_view]; [m_view setHidden:!window()->isVisible()]; } - const qreal opacity = qt_window_private(window())->opacity; - if (!qFuzzyCompare(opacity, qreal(1.0))) - setOpacity(opacity); - setMask(QHighDpi::toNativeLocalRegion(window()->mask(), window())); } |