From a040997551d292fffd31edd7549835f85783c05e Mon Sep 17 00:00:00 2001 From: rope Date: Sat, 1 Aug 2026 20:58:18 +0100 Subject: [PATCH] quickshell: fix the trace hiding the event it was added to catch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The rawEvent gate keyed off launcherPanel.open, but the focus-grab clear sets open=false before Hyprland's IPC event arrives, so the compositor event around each clear was filtered out — the log came back empty. Key off a timestamp instead, and report who holds focus when the grab clears. --- settings/quickshell.nix | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/settings/quickshell.nix b/settings/quickshell.nix index 2aeb7fd..0525c17 100644 --- a/settings/quickshell.nix +++ b/settings/quickshell.nix @@ -1531,6 +1531,13 @@ in // Non-empty when the query parses as arithmetic. property string calcResult: "" + // Diagnostic clock (ms since the last toggle). Deliberately + // NOT `open`-gated: the first version of the compositor trace + // keyed off `open`, and the focus-grab clear sets open=false + // before Hyprland's IPC event arrives, so it hid the one + // event worth seeing. + property double traceFrom: 0 + readonly property var catDefs: [ { key: "All", label: "All apps", icon: "layout-grid" }, { key: "Network", label: "Internet", icon: "globe" }, @@ -1572,6 +1579,7 @@ in // from "Super+R never arrived": if the journal shows // `-> open` with no matching focusgrab line after it, // the panel really did open and something drew over it. + traceFrom = Date.now(); console.log("launcher toggle -> " + (open ? "open" : "closed")); if (open) { searchInput.text = ""; @@ -2948,9 +2956,17 @@ in // hyprland.nix exists for), and only the timing tells // them apart — a clear within a few ms of the toggle // above was not a human clicking. - if (launcherPanel.open || bar.activeDropdown !== null) - console.log("focusgrab cleared: closing launcher=" - + launcherPanel.open + " dropdown=" + (bar.activeDropdown !== null)); + if (launcherPanel.open || bar.activeDropdown !== null) { + // Who holds focus at clear time is the whole + // question: a competitor that stole it back, or + // nothing at all (a grab the compositor refused). + const top = Hyprland.activeToplevel; + const cls = top && top.lastIpcObject ? top.lastIpcObject["class"] : "?"; + console.log("focusgrab cleared +" + (Date.now() - launcherPanel.traceFrom) + + "ms: launcher=" + launcherPanel.open + + " dropdown=" + (bar.activeDropdown !== null) + + " focus=" + (top ? cls + " / " + top.title : "none")); + } launcherPanel.open = false; bar.closeAllDropdowns(); } @@ -2966,8 +2982,9 @@ in Connections { target: Hyprland function onRawEvent(event) { - if (launcherPanel.open || bar.activeDropdown !== null) - console.log("hypr event: " + event.name + " | " + event.data); + const dt = Date.now() - launcherPanel.traceFrom; + if (dt < 3000) + console.log("hypr event +" + dt + "ms: " + event.name + " | " + event.data); } }