From 6a4ce613bbd651d62d282f8d309d1215efb432c2 Mon Sep 17 00:00:00 2001 From: bbedward Date: Thu, 3 Sep 2026 12:51:15 -0400 Subject: [PATCH] colorpicker/popout: add instant-close machinery for eye dropper --- .../Modules/DankBar/Popouts/ColorPickerPopout.qml | 2 +- quickshell/Widgets/DankPopout.qml | 10 +++++++++- quickshell/Widgets/DankPopoutConnected.qml | 15 +++++++++++++++ quickshell/Widgets/DankPopoutStandalone.qml | 13 +++++++++++++ 4 files changed, 38 insertions(+), 2 deletions(-) diff --git a/quickshell/Modules/DankBar/Popouts/ColorPickerPopout.qml b/quickshell/Modules/DankBar/Popouts/ColorPickerPopout.qml index 0827783ac..d802724d0 100644 --- a/quickshell/Modules/DankBar/Popouts/ColorPickerPopout.qml +++ b/quickshell/Modules/DankBar/Popouts/ColorPickerPopout.qml @@ -20,7 +20,7 @@ DankPopout { anchors.fill: parent initialColor: SessionData.recentColors.length > 0 ? SessionData.recentColors[0] : Theme.primary onCloseRequested: root.close() - onHideRequested: root.close() + onHideRequested: root.instantClose() onShowRequested: root.open() } } diff --git a/quickshell/Widgets/DankPopout.qml b/quickshell/Widgets/DankPopout.qml index 4f4cd1b14..110bc1ceb 100644 --- a/quickshell/Widgets/DankPopout.qml +++ b/quickshell/Widgets/DankPopout.qml @@ -169,11 +169,19 @@ Item { } function close() { + _close(false); + } + + function instantClose() { + _close(true); + } + + function _close(instant) { _pendingOpen = false; _pendingOpenTimer.stop(); transientSurfaceTracker?.closeAll?.(); if (impl.item) { - impl.item.close(); + instant ? impl.item.instantClose() : impl.item.close(); return; } PopoutManager.hidePopout(root); diff --git a/quickshell/Widgets/DankPopoutConnected.qml b/quickshell/Widgets/DankPopoutConnected.qml index 90389265c..30c628b4e 100644 --- a/quickshell/Widgets/DankPopoutConnected.qml +++ b/quickshell/Widgets/DankPopoutConnected.qml @@ -520,6 +520,21 @@ Item { closeTimer.restart(); } + function instantClose() { + closeTimer.stop(); + _endMorphTravel(); + _resetPublishedBody(); + animationsEnabled = false; + isClosing = false; + shouldBeVisible = false; + _keyboardReady = false; + _primeContent = false; + contentWindow.visible = false; + PopoutManager.hidePopout(popoutHandle); + popoutClosed(); + Qt.callLater(() => animationsEnabled = true); + } + function toggle() { shouldBeVisible ? close() : open(); } diff --git a/quickshell/Widgets/DankPopoutStandalone.qml b/quickshell/Widgets/DankPopoutStandalone.qml index 5653a57bb..ce1ba474f 100644 --- a/quickshell/Widgets/DankPopoutStandalone.qml +++ b/quickshell/Widgets/DankPopoutStandalone.qml @@ -395,6 +395,19 @@ Item { closeTimer.restart(); } + function instantClose() { + closeTimer.stop(); + animationsEnabled = false; + isClosing = false; + shouldBeVisible = false; + _primeContent = false; + contentWindow.visible = false; + backgroundWindow.visible = false; + PopoutManager.hidePopout(popoutHandle); + popoutClosed(); + Qt.callLater(() => animationsEnabled = true); + } + function toggle() { shouldBeVisible ? close() : open(); }