The hidden.is_some() guard dropped a hide-reason upgrade: an Idle-hidden
cursor that received a touch stayed Idle, so a later click or scroll
revealed it where the spec says a touch-hidden cursor waits for real
movement. Reachable on the default config — fullscreen video, cursor
idle-hidden after 3s, tap the screen, nudge the scroll wheel. The guard
itself has to stay, or every keystroke with while_typing on reschedules a
render on every output; so it now returns early only when the reason is
unchanged or already Touch.
hide_cursor also returned before clearing idle_timer and last_armed when
the pointer was grabbed, leaving both stale while on_idle_timer's
neighbouring Drop arm cleared them carefully. Clearing in hide_cursor
before the grab check fixes both call sites at once — hide_cursor_now
removes the source itself, and the Hide arm returns TimeoutAction::Drop —
rather than restating the cleanup in one match arm.
Drafted with Claude (Anthropic); reviewed and tested by the committer.
refresh_idle_timer armed for the full timeout measured from now, which is
right only for notify_cursor_activity — it stamps activity immediately
before arming. The other callers deliberately do not stamp, so with
idle_timeout: Some(10) a user typing continuously never saw the cursor
hide: every key press and release pushed the deadline out by a fresh ten
seconds. That inverts the feature and regresses the shipped
cursor_hide_timeout behaviour.
resolve's RearmAfter cannot recover it — it only corrects a timer that
fires too early. So the delay is now shortest_timeout minus the time
already elapsed, extracted as CursorHideConfig::arm_delay and table
tested; the arithmetic handed to Timer::from_duration was the one part of
this path with no coverage. A zero delay is fine: the timer fires on the
next loop iteration and resolve decides.
Also rename fullscreen_focused to fullscreen_on_active_output, which is
what seat.active_output() actually reports, and log an arming failure
rather than silently disabling cursor hiding.
Drafted with Claude (Anthropic); reviewed and tested by the committer.
Serde ignores unknown fields but errors on missing ones, so adding a
fifth trigger later would make every existing cursor_hide file fail to
deserialize. get_entry would then substitute the struct default and
Config::load swallows the error — its warn! loop is behind
cfg!(debug_assertions) — silently resetting everyone's settings on
upgrade. That is the exact failure this key was grouped to avoid.
It also has a present-day effect: the migration shim cannot tell "absent"
from "present but unparseable", so a partial hand-written cursor_hide was
treated as absent and overwritten — and hand-editing is what the shim's
audience does.
Drafted with Claude (Anthropic); reviewed and tested by the committer.
Typing hides on a real keystroke only — a bare modifier press is excluded
so Super+drag keeps its cursor. Touch hides until the pointer next moves,
which the reveal rule enforces via HideReason::Touch.
Drafted with Claude (Anthropic); reviewed and tested by the committer.
The timer now decides on fire rather than at arm time, so a shorter
fullscreen timeout applies without hooking any of the six fullscreen
transition sites in shell/mod.rs. Arming still touches no shell lock,
which the PointerMotion call site requires.
hidden becomes Option<HideReason> so the reveal rule can depend on why
the cursor went away.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Drafted with Claude (Anthropic); reviewed and tested by the committer.
Reads the legacy key once at startup when the new one is absent, so the
handful of people who set it by hand from the cosmic-settings#603 thread
do not silently lose auto-hide. The old file is left on disk so a
downgrade still finds it.
Drafted with Claude (Anthropic); reviewed and tested by the committer.
Replaces the flat cursor_hide_timeout key with a grouped cursor_hide key
carrying the idle, fullscreen-idle, typing and touch triggers, plus the
pure decision function the compositor's idle timer evaluates on fire.
The fullscreen timeout shortens the global one rather than replacing it,
so an unset fullscreen timeout cannot suppress an enabled global one.
Drafted with Claude (Anthropic); reviewed and tested by the committer.
A sleeping wireless keyboard relit blanked displays and idle never re-armed.
Written with assistance from Claude Opus 5.0. Reviewed, built and tested by the
author, who understands the changes in full.
When no saved configuration matches the current output set, positions
were assigned in hotplug/registration order. On hotplug races (e.g.
reconnecting monitors through a KVM switch) outputs can appear in
arbitrary order, producing a swapped left/right layout that then gets
persisted to outputs.ron, poisoning all future reconnects.
Sort outputs by connector name before generating fallback positions so
the layout is deterministic regardless of arrival order.
AI disclosure: implemented with the assistance of an LLM coding agent,
directed, reviewed, and tested by the author.
Signed-off-by: apassert <249084898+apassert@users.noreply.github.com>
Replace the symmetric_difference over two freshly-materialized HashSets
with direct contains_key lookups on the existing key sets. Semantically
identical (set difference non-empty iff any key is in exactly one set) but
removes two heap HashSet allocations plus hashing of every key on each
widget update. Also drops the now-unused HashSet import.
Implements compact-idiomatic-code-20 from the cosmic-comp optimization
report. Created with the help of DeepSeek V4 Flash.