summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2023-03-13 13:33:58 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-03-24 08:38:44 +0000
commit57f44282b040a3ce0b44bb0fc63bfca0d96b9cb5 (patch)
treecf7dd9cd0c84810078da2a287e75817fafdc05ed /src
parent6451fdffcfc6f12319e276950368ebb7fe04c50c (diff)
Don't accept QWSI::CloseEvent when the window is blocked by a modal window
If a window is blocked by another modal window, and we decide that as a result we should not propagate the close event, we need to also report this back to the platform plugin, so that it can tell the operating system to not close the window. This is a problem on macOS, where the system doesn't natively support transient parents being blocked by a window-modal window, so the OS will still allow interaction with the title bar close button, resulting in a QWSI close event being delivered. Fixes: QTBUG-104905 Change-Id: I09ff15b0fbb1002a8f9d83d932ca766ed510f0a0 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit fb70893dd5e616356260fe0b391dd77007c7bfc7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qguiapplication.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index fe0750d1f4..085552fab4 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -2653,6 +2653,7 @@ void QGuiApplicationPrivate::processCloseEvent(QWindowSystemInterfacePrivate::Cl
if (e->window.data()->d_func()->blockedByModalWindow && !e->window.data()->d_func()->inClose) {
// a modal window is blocking this window, don't allow close events through, unless they
// originate from a call to QWindow::close.
+ e->eventAccepted = false;
return;
}