quickshell: fix the trace hiding the event it was added to catch
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.
This commit is contained in:
parent
b57c06da5e
commit
a040997551
1 changed files with 22 additions and 5 deletions
|
|
@ -1531,6 +1531,13 @@ in
|
||||||
// Non-empty when the query parses as arithmetic.
|
// Non-empty when the query parses as arithmetic.
|
||||||
property string calcResult: ""
|
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: [
|
readonly property var catDefs: [
|
||||||
{ key: "All", label: "All apps", icon: "layout-grid" },
|
{ key: "All", label: "All apps", icon: "layout-grid" },
|
||||||
{ key: "Network", label: "Internet", icon: "globe" },
|
{ key: "Network", label: "Internet", icon: "globe" },
|
||||||
|
|
@ -1572,6 +1579,7 @@ in
|
||||||
// from "Super+R never arrived": if the journal shows
|
// from "Super+R never arrived": if the journal shows
|
||||||
// `-> open` with no matching focusgrab line after it,
|
// `-> open` with no matching focusgrab line after it,
|
||||||
// the panel really did open and something drew over it.
|
// the panel really did open and something drew over it.
|
||||||
|
traceFrom = Date.now();
|
||||||
console.log("launcher toggle -> " + (open ? "open" : "closed"));
|
console.log("launcher toggle -> " + (open ? "open" : "closed"));
|
||||||
if (open) {
|
if (open) {
|
||||||
searchInput.text = "";
|
searchInput.text = "";
|
||||||
|
|
@ -2948,9 +2956,17 @@ in
|
||||||
// hyprland.nix exists for), and only the timing tells
|
// hyprland.nix exists for), and only the timing tells
|
||||||
// them apart — a clear within a few ms of the toggle
|
// them apart — a clear within a few ms of the toggle
|
||||||
// above was not a human clicking.
|
// above was not a human clicking.
|
||||||
if (launcherPanel.open || bar.activeDropdown !== null)
|
if (launcherPanel.open || bar.activeDropdown !== null) {
|
||||||
console.log("focusgrab cleared: closing launcher="
|
// Who holds focus at clear time is the whole
|
||||||
+ launcherPanel.open + " dropdown=" + (bar.activeDropdown !== null));
|
// 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;
|
launcherPanel.open = false;
|
||||||
bar.closeAllDropdowns();
|
bar.closeAllDropdowns();
|
||||||
}
|
}
|
||||||
|
|
@ -2966,8 +2982,9 @@ in
|
||||||
Connections {
|
Connections {
|
||||||
target: Hyprland
|
target: Hyprland
|
||||||
function onRawEvent(event) {
|
function onRawEvent(event) {
|
||||||
if (launcherPanel.open || bar.activeDropdown !== null)
|
const dt = Date.now() - launcherPanel.traceFrom;
|
||||||
console.log("hypr event: " + event.name + " | " + event.data);
|
if (dt < 3000)
|
||||||
|
console.log("hypr event +" + dt + "ms: " + event.name + " | " + event.data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue