quickshell: fix clock click reopening after grabFocus dismiss

Clicking clock while popup open triggered grabFocus dismiss
then immediately reopened. Add justDismissed guard so the
click handler ignores the click that caused the dismiss.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
rope 2026-05-26 15:23:55 +01:00
parent a6af5ac882
commit 3b7cc98fc9

View file

@ -518,6 +518,7 @@ in
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
onClicked: { onClicked: {
if (calPopup.justDismissed) return;
if (calPopup.visible) { if (calPopup.visible) {
calPopup.open = false; calPopup.open = false;
calCloseTimer.start(); calCloseTimer.start();
@ -841,6 +842,7 @@ in
color: "transparent" color: "transparent"
property bool open: false property bool open: false
property bool justDismissed: false
property real fullWidth: calCol.width + 32 property real fullWidth: calCol.width + 32
property real fullHeight: calCol.height + 24 property real fullHeight: calCol.height + 24
@ -852,9 +854,17 @@ in
open = true; open = true;
} else { } else {
open = false; open = false;
justDismissed = true;
dismissGuardTimer.start();
} }
} }
Timer {
id: dismissGuardTimer
interval: 100
onTriggered: calPopup.justDismissed = false
}
// Concave corner left // Concave corner left
Item { Item {
anchors.right: calContent.left anchors.right: calContent.left