From 3951cd6b188e7815dfd41d08ccda63a669705db9 Mon Sep 17 00:00:00 2001 From: bbedward Date: Thu, 16 Jul 2026 10:19:44 -0400 Subject: [PATCH] popout: guard against bad state and reset input method on close port 1.5 --- quickshell/Widgets/DankPopout.qml | 12 ++++++++++-- quickshell/Widgets/DankPopoutConnected.qml | 7 +++++++ quickshell/Widgets/DankPopoutStandalone.qml | 7 +++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/quickshell/Widgets/DankPopout.qml b/quickshell/Widgets/DankPopout.qml index a63bc69bc..55fc76a5c 100644 --- a/quickshell/Widgets/DankPopout.qml +++ b/quickshell/Widgets/DankPopout.qml @@ -174,8 +174,15 @@ Item { _pendingOpen = false; _pendingOpenTimer.stop(); transientSurfaceTracker?.closeAll?.(); - if (impl.item) + if (impl.item) { impl.item.close(); + return; + } + PopoutManager.hidePopout(root); + if (!shouldBeVisible) + return; + shouldBeVisible = false; + popoutClosed(); } function cancelHoverDismiss() { @@ -315,7 +322,8 @@ Item { it.hoverDismissEnabled = Qt.binding(() => root.hoverDismissEnabled); it.hoverDismissSuspended = Qt.binding(() => root.effectiveHoverDismissSuspended); - it.shouldBeVisible = root.shouldBeVisible; + if (root.shouldBeVisible && !_pendingOpen) + root.shouldBeVisible = false; if (root._primeContent && typeof it.primeContent === "function") it.primeContent(); if (_pendingOpen) diff --git a/quickshell/Widgets/DankPopoutConnected.qml b/quickshell/Widgets/DankPopoutConnected.qml index 31f97b8e4..0857b905a 100644 --- a/quickshell/Widgets/DankPopoutConnected.qml +++ b/quickshell/Widgets/DankPopoutConnected.qml @@ -923,6 +923,13 @@ Item { visible: false color: "transparent" + onVisibleChanged: { + if (visible || !Qt.inputMethod) + return; + Qt.inputMethod.hide(); + Qt.inputMethod.reset(); + } + PopoutHoverDismiss { id: hoverDismissController anchors.fill: parent diff --git a/quickshell/Widgets/DankPopoutStandalone.qml b/quickshell/Widgets/DankPopoutStandalone.qml index da90df263..ff88ae30a 100644 --- a/quickshell/Widgets/DankPopoutStandalone.qml +++ b/quickshell/Widgets/DankPopoutStandalone.qml @@ -630,6 +630,13 @@ Item { color: "transparent" readonly property bool closeVisualActive: root.shouldBeVisible || root.isClosing + onVisibleChanged: { + if (visible || !Qt.inputMethod) + return; + Qt.inputMethod.hide(); + Qt.inputMethod.reset(); + } + PopoutHoverDismiss { id: hoverDismissController anchors.fill: parent