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.
This makes `cosmic-osk` show a group change on `super+space`. Previously
a change like that wouldn't be sent until a keyboard input changed the
modifier state, for instance releasing the shift key.
1. Change magnifier zoom stepping from additive to multiplicative,
because zoom is a ratio, not a difference, and human perception is
logarithmic (browser zoom steps, map zoom levels, microscope powers).
2. Add `pub const ZoomConfig::ZOOM_INCREMENT_PRESETS` with two
additional presets: 10% (macOS, Cinnamon) and 75% (for users at
70-90x zoom).
3. Bound the zoom level to a generous maximum, beyond what anyone is expected
to need, to prevent runaway / unrecoverable levels (#1230).
Full background and rationale at #2615.
I used AI to assist with research and issue writeup. Code is 100% mine.
- Closes#2615.
- Fixes#1239.
- Partially addresses #1230 and #1237.