diff --git a/modules/HoverPanel.qml b/modules/HoverPanel.qml index da37516..a71576c 100644 --- a/modules/HoverPanel.qml +++ b/modules/HoverPanel.qml @@ -67,16 +67,33 @@ PanelWindow { panelContainer.x = Math.max(0, Math.min(Math.round(cx - root.contentWidth / 2), sw - root.contentWidth)); } + // Grace period: after _show(), suppress auto-close briefly so Niri has time + // to route wl_pointer.enter to the new overlay surface (cursor may be stationary). + property bool _grace: false + Timer { + id: _graceTimer + interval: 400 + onTriggered: { + root._grace = false; + if (!root.showPanel) + root.dismiss(); + } + } + function _show() { _updatePosition(); _winVisible = true; hideAnim.stop(); showAnim.start(); + _grace = true; + _graceTimer.restart(); } function dismiss() { showAnim.stop(); hideAnim.start(); + _grace = false; + _graceTimer.stop(); } Component.onCompleted: if (popupMode) @@ -84,8 +101,8 @@ PanelWindow { Timer { id: _hideTimer - interval: 50 - onTriggered: if (!root.showPanel) + interval: 150 + onTriggered: if (!root.showPanel && !root._grace) root.dismiss() }