aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/companion/Companion.qml
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-23 15:26:27 +0200
committerDanilo M. <danix@danix.xyz>2026-10-23 15:26:27 +0200
commitb5999349a9013a4d80ca8085bba5b9d06a104739 (patch)
treec05e0f0e5cbecb35101a0298a95fbf9c07719073 /desktop/companion/Companion.qml
parenta44c3ebc3eacffde9dc0ec932aa74dc7faa95eb2 (diff)
downloadquickshell-b5999349a9013a4d80ca8085bba5b9d06a104739.tar.gz
quickshell-b5999349a9013a4d80ca8085bba5b9d06a104739.zip
companion: above the assistant's dim, and typing means a run of keys
The assistant canvas is a full-screen Overlay surface mapped on open, so it covered her and her think and wave were never seen. She moves to the Overlay layer and unmaps and maps again when the canvas opens, since a later surface stacks above an earlier one and Hyprland 0.56.2 has no layer rule to order them: an `order` key was tried, raised no config error, and did nothing. Every key sent her into watching, a shortcut included. The pulse comes at most once a second, so a lone key is one pulse; she now watches from the second pulse within 2.5 s. The hypr-theme hook drops modifiers and chords on its side. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'desktop/companion/Companion.qml')
-rw-r--r--desktop/companion/Companion.qml25
1 files changed, 23 insertions, 2 deletions
diff --git a/desktop/companion/Companion.qml b/desktop/companion/Companion.qml
index 0a1360f..1e96ff4 100644
--- a/desktop/companion/Companion.qml
+++ b/desktop/companion/Companion.qml
@@ -51,7 +51,9 @@ PanelWindow {
implicitHeight: 260
color: "transparent"
exclusionMode: ExclusionMode.Ignore
- WlrLayershell.layer: WlrLayer.Top
+ // Overlay, the assistant canvas's layer, so she can sit above its dim
+ // (see remap below).
+ WlrLayershell.layer: WlrLayer.Overlay
WlrLayershell.namespace: "keystone-companion"
WlrLayershell.keyboardFocus: WlrKeyboardFocus.None
// Her body only: clicks anywhere else, the bubble included, reach the
@@ -69,6 +71,7 @@ PanelWindow {
property double repliedAt: 0
property double mockAt: 0
property double typingAt: 0
+ property double pulseAt: 0
property double wakeAt: 0
property double lastLineAt: 0
property double lastMonologueAt: 0
@@ -112,7 +115,11 @@ PanelWindow {
const what = event.data.trim();
const t = Date.now();
if (what === "keystone-typing") {
- root.typingAt = t;
+ // Pulses come at most once a second, so a lone key (a
+ // shortcut, an arrow) is one pulse and typing is a run
+ // of them: she watches from the second within 2.5 s.
+ if (t - root.pulseAt < 2500) root.typingAt = t;
+ root.pulseAt = t;
} else if (what === "keystone-delete") {
root.typingAt = t;
if (Mood.mockAllowed(root.mockAt, t)) {
@@ -129,12 +136,26 @@ 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");
}
}
+ // 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.
+ property bool remapping: false
+ visible: !root.remapping
+ Timer { id: remap; interval: 100; 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.
readonly property bool shoved: {