diff --git a/settings/hyprland.nix b/settings/hyprland.nix index 278f3a8..10a71dc 100644 --- a/settings/hyprland.nix +++ b/settings/hyprland.nix @@ -518,10 +518,11 @@ in MouseArea { anchors.fill: parent onClicked: { - if (calPopup.visible) { + if (calPopup.visible && !calPopup.closing) { + calPopup.closing = true; calPopup.open = false; calCloseTimer.start(); - } else { + } else if (!calPopup.visible) { calPopup.visible = true; } } @@ -530,7 +531,7 @@ in Timer { id: calCloseTimer interval: 230 - onTriggered: calPopup.visible = false + onTriggered: { calPopup.closing = false; calPopup.visible = false; } } } @@ -841,6 +842,7 @@ in color: "transparent" property bool open: false + property bool closing: false property real fullWidth: calCol.width + 32 property real fullHeight: calCol.height + 24 @@ -849,12 +851,11 @@ in onVisibleChanged: { if (visible) { - open = true; - } - } - - onActiveChanged: { - if (!active && visible) { + if (!closing) open = true; + } else if (open && !closing) { + // grabFocus hid us — re-show and animate closed + closing = true; + visible = true; open = false; calCloseTimer.start(); }