macOS: Handle asynchronous deminiaturizing of windows
As of macOS 13 this operation is now asynchronous. Change-Id: I9431e24803c53a3fa455707b20a6814290718766 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit dc1f931a9169484b8f2c39bd1f8d4bd4e148ea14) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
dba46183cd
commit
9702e8107f
@ -690,9 +690,10 @@ void QCocoaWindow::applyWindowState(Qt::WindowStates requestedState)
|
|||||||
switch (currentState) {
|
switch (currentState) {
|
||||||
case Qt::WindowMinimized:
|
case Qt::WindowMinimized:
|
||||||
[nsWindow deminiaturize:sender];
|
[nsWindow deminiaturize:sender];
|
||||||
Q_ASSERT_X(windowState() != Qt::WindowMinimized, "QCocoaWindow",
|
// Deminiaturizing is not synchronous, so we need to wait for the
|
||||||
"[NSWindow deminiaturize:] is synchronous");
|
// NSWindowDidMiniaturizeNotification before continuing to apply
|
||||||
break;
|
// the new state.
|
||||||
|
return;
|
||||||
case Qt::WindowFullScreen: {
|
case Qt::WindowFullScreen: {
|
||||||
toggleFullScreen();
|
toggleFullScreen();
|
||||||
// Exiting fullscreen is not synchronous, so we need to wait for the
|
// Exiting fullscreen is not synchronous, so we need to wait for the
|
||||||
@ -858,7 +859,15 @@ void QCocoaWindow::windowDidDeminiaturize()
|
|||||||
if (!isContentView())
|
if (!isContentView())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Qt::WindowState requestedState = window()->windowState();
|
||||||
|
|
||||||
handleWindowStateChanged();
|
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)
|
void QCocoaWindow::handleWindowStateChanged(HandleFlags flags)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user