macOS: Handle asynchronous deminiaturizing of windows
As of macOS 13 this operation is now asynchronous. Pick-to: 6.4 6.2 5.15 Change-Id: I9431e24803c53a3fa455707b20a6814290718766 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>bb10
parent
b4780f1990
commit
dc1f931a91
|
|
@ -690,9 +690,10 @@ void QCocoaWindow::applyWindowState(Qt::WindowStates requestedState)
|
|||
switch (currentState) {
|
||||
case Qt::WindowMinimized:
|
||||
[nsWindow deminiaturize:sender];
|
||||
Q_ASSERT_X(windowState() != Qt::WindowMinimized, "QCocoaWindow",
|
||||
"[NSWindow deminiaturize:] is synchronous");
|
||||
break;
|
||||
// Deminiaturizing is not synchronous, so we need to wait for the
|
||||
// NSWindowDidMiniaturizeNotification before continuing to apply
|
||||
// the new state.
|
||||
return;
|
||||
case Qt::WindowFullScreen: {
|
||||
toggleFullScreen();
|
||||
// Exiting fullscreen is not synchronous, so we need to wait for the
|
||||
|
|
@ -858,7 +859,15 @@ void QCocoaWindow::windowDidDeminiaturize()
|
|||
if (!isContentView())
|
||||
return;
|
||||
|
||||
Qt::WindowState requestedState = window()->windowState();
|
||||
|
||||
handleWindowStateChanged();
|
||||
|
||||
if (requestedState != windowState() && requestedState != Qt::WindowMinimized) {
|
||||
// We were only going out of minimized as an intermediate step before
|
||||
// progressing into the final step, so re-sync the desired state.
|
||||
applyWindowState(requestedState);
|
||||
}
|
||||
}
|
||||
|
||||
void QCocoaWindow::handleWindowStateChanged(HandleFlags flags)
|
||||
|
|
|
|||
Loading…
Reference in New Issue