From e5fff91ae66fa44379ffe31f25ed8cf5c6807d67 Mon Sep 17 00:00:00 2001 From: bbedward Date: Wed, 3 Jun 2026 10:49:51 -0400 Subject: [PATCH] notification: fix modal escape key handling in connected mode fixes #2566 --- quickshell/Modals/Common/DankModalConnected.qml | 13 ++++++------- quickshell/Modals/Common/DankModalStandalone.qml | 13 ++++++------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/quickshell/Modals/Common/DankModalConnected.qml b/quickshell/Modals/Common/DankModalConnected.qml index cd91b743..b0648a16 100644 --- a/quickshell/Modals/Common/DankModalConnected.qml +++ b/quickshell/Modals/Common/DankModalConnected.qml @@ -262,6 +262,7 @@ Item { clickCatcher.visible = true; if (!contentWindow.visible) contentWindow.visible = true; + opened(); shouldHaveFocus = false; Qt.callLater(() => shouldHaveFocus = Qt.binding(() => shouldBeVisible)); }); @@ -535,13 +536,11 @@ Item { implicitHeight: root.useSingleWindow ? 0 : root.alignedHeight + (shadowBuffer * 2) onVisibleChanged: { - if (visible) { - opened(); - } else { - if (Qt.inputMethod) { - Qt.inputMethod.hide(); - Qt.inputMethod.reset(); - } + if (visible) + return; + if (Qt.inputMethod) { + Qt.inputMethod.hide(); + Qt.inputMethod.reset(); } } diff --git a/quickshell/Modals/Common/DankModalStandalone.qml b/quickshell/Modals/Common/DankModalStandalone.qml index 8d77e529..3bf96a75 100644 --- a/quickshell/Modals/Common/DankModalStandalone.qml +++ b/quickshell/Modals/Common/DankModalStandalone.qml @@ -90,6 +90,7 @@ Item { if (!useSingleWindow) clickCatcher.visible = true; contentWindow.visible = true; + opened(); shouldHaveFocus = false; Qt.callLater(() => shouldHaveFocus = Qt.binding(() => shouldBeVisible)); } @@ -286,13 +287,11 @@ Item { implicitHeight: root.useSingleWindow ? 0 : root.alignedHeight + (shadowBuffer * 2) onVisibleChanged: { - if (visible) { - opened(); - } else { - if (Qt.inputMethod) { - Qt.inputMethod.hide(); - Qt.inputMethod.reset(); - } + if (visible) + return; + if (Qt.inputMethod) { + Qt.inputMethod.hide(); + Qt.inputMethod.reset(); } }