From 8bee713fd3dd4cdc13c75c122c18de221cb9c07e Mon Sep 17 00:00:00 2001 From: Damocles Date: Tue, 14 Apr 2026 00:37:54 +0200 Subject: [PATCH] hoverpanel: add 400ms grace period on show, increase hide debounce to 150ms --- modules/HoverPanel.qml | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) 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() }