From 53d4feafd0cf28da36297942778965d2b22c2811 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 23 Oct 2026 15:30:18 +0200 Subject: companion: above every overlay that opens, with a hop back in Remapping only when the assistant opened left her under rofi and the keybind reminder, which map on the same Overlay layer later. She now remaps on Hyprland's openlayer event for any namespace but her own, restarting the timer so a burst of openings ends with her on top. The bare remap read as a flicker. Unmapped she now counts as away, so her figure drops out unseen during the 400 ms and plays its entrance when she is back: a vanish and a hop in. Co-Authored-By: Claude Opus 5.5 --- desktop/companion/Companion.qml | 27 ++++++++++++++------------- desktop/companion/README.md | 10 ++++++---- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/desktop/companion/Companion.qml b/desktop/companion/Companion.qml index 1e96ff4..3abf222 100644 --- a/desktop/companion/Companion.qml +++ b/desktop/companion/Companion.qml @@ -51,8 +51,7 @@ PanelWindow { implicitHeight: 260 color: "transparent" exclusionMode: ExclusionMode.Ignore - // Overlay, the assistant canvas's layer, so she can sit above its dim - // (see remap below). + // Overlay, so she can sit above the other overlays (see remap below). WlrLayershell.layer: WlrLayer.Overlay WlrLayershell.namespace: "keystone-companion" WlrLayershell.keyboardFocus: WlrKeyboardFocus.None @@ -127,6 +126,11 @@ PanelWindow { root.say("mock"); } } + } else if (event.name === "openlayer" && event.data.trim() !== "keystone-companion") { + // Something mapped above her: the assistant's dim, rofi, + // the keybind reminder. Map again, after it. + root.remapping = true; + remap.restart(); } else if (["fullscreen", "activewindowv2", "workspacev2"].includes(event.name)) { Hyprland.refreshToplevels(); fsSettle.restart(); @@ -136,11 +140,6 @@ PanelWindow { Connections { target: root.asst - function onOpenChanged() { - if (!root.asst.open) return; - root.remapping = true; - remap.restart(); - } function onReplied() { root.repliedAt = Date.now(); root.say("ready"); @@ -148,13 +147,15 @@ PanelWindow { } // Hyprland stacks a later surface above an earlier one on the same layer - // and 0.56.2 has no layer rule to order them, so the canvas's full-screen - // dim covered her and her think and wave were never seen. When it opens - // she unmaps and maps again, after it. - // ponytail: a remap per open; a surface mapped later still covers her. + // and 0.56.2 has no layer rule to order them, so the assistant canvas's + // full-screen dim covered her and her think and wave were never seen. + // Whenever another layer surface opens (openlayer, below), she unmaps + // and maps again, after it. Unmapped she counts as away, so her figure + // drops out unseen and plays its entrance once she is back: a vanish + // and a hop in, rather than a flicker. property bool remapping: false visible: !root.remapping - Timer { id: remap; interval: 100; onTriggered: root.remapping = false } + Timer { id: remap; interval: 400; onTriggered: root.remapping = false } // Balloons stack bottom-right of their screen. When that is her corner, // any balloon on screen shoves her left past the stack. @@ -186,7 +187,7 @@ PanelWindow { // Hidden: no sprite, no bubble. Away adds the dodge, which hides the // sprite but lets its line show. readonly property bool hidden: !root.present || root.fullscreen === 2 || root.hopping - readonly property bool away: root.hidden || root.dodging + readonly property bool away: root.hidden || root.dodging || root.remapping // --- speech --------------------------------------------------------- diff --git a/desktop/companion/README.md b/desktop/companion/README.md index a7ce37f..45e522d 100644 --- a/desktop/companion/README.md +++ b/desktop/companion/README.md @@ -41,10 +41,12 @@ frame falls back to its outfit's `base`. Super held, so a shortcut is not typing; Shift and AltGr still count. She watches only from the second pulse within 2.5 s, so a lone key is not typing either. -- She is on the Overlay layer and remaps when the assistant canvas opens: - Hyprland stacks a later surface above an earlier one on a layer, and - 0.56.2 has no layer rule to order them (no `order` key in the binary; - an unknown key raises no config error). +- She is on the Overlay layer and remaps whenever another layer surface + opens (Hyprland's `openlayer` event: the assistant's dim, rofi, the + keybind reminder), vanishing and hopping back in, because Hyprland + stacks a later surface above an earlier one on a layer, and 0.56.2 has + no layer rule to order them (no `order` key in the binary; an unknown + key raises no config error). - She only feels the pointer while it is over her: Quickshell has no global pointer and Hyprland sends no motion events. Hence the 0.6 s dodge rather than moving away as the pointer approaches. -- cgit v1.2.3