Display rotation applies live but is never saved; layout save also wipes other monitors and forces VRR off #28

Closed
opened 2026-10-01 22:20:41 +08:00 by Breadway · 0 comments
Owner

How I found it

Nested Hyprland session with BOS's own scripts/display/monitors.lua loader. Displays > Layout: set Rotation to Right; hyprctl monitors showed transform: 1, but the written hypr/monitors.json contained only output/mode/position/scale. Also: after applying a scale change, the sandbox monitors.json lost its saved eDP-1 entry and contained only the connected output.

Code: src/src/commands/hyprland.rs apply_monitor_layout (around line 162).

Confidence

High for rotation (reproduced and the struct has no field). High for dropped entries (reproduced; code writes only the live list). Medium for VRR (code reading).

Explanation

  1. MonitorRule has no transform, so rotation is lost on the next login or hyprctl reload.
  2. apply_monitor_layout builds rules only from the currently connected monitors and calls write_monitor_rules(&rules), replacing the file. A saved layout for an unplugged external display is deleted every time any display setting is changed.
  3. Every live apply emits vrr = false, silently turning VRR off.

Expected: merge into existing rules by output name, persist transform (and VRR), never drop rules for disconnected outputs. Also add a "Keep these display settings?" countdown that reverts, since a bad scale or rotation can make the screen hard to use.

## How I found it Nested Hyprland session with BOS's own `scripts/display/monitors.lua` loader. Displays > Layout: set Rotation to Right; `hyprctl monitors` showed `transform: 1`, but the written `hypr/monitors.json` contained only output/mode/position/scale. Also: after applying a scale change, the sandbox `monitors.json` lost its saved `eDP-1` entry and contained only the connected output. Code: `src/src/commands/hyprland.rs` `apply_monitor_layout` (around line 162). ## Confidence High for rotation (reproduced and the struct has no field). High for dropped entries (reproduced; code writes only the live list). Medium for VRR (code reading). ## Explanation 1. `MonitorRule` has no `transform`, so rotation is lost on the next login or `hyprctl reload`. 2. `apply_monitor_layout` builds `rules` only from the currently connected monitors and calls `write_monitor_rules(&rules)`, replacing the file. A saved layout for an unplugged external display is deleted every time any display setting is changed. 3. Every live apply emits `vrr = false`, silently turning VRR off. Expected: merge into existing rules by output name, persist transform (and VRR), never drop rules for disconnected outputs. Also add a "Keep these display settings?" countdown that reverts, since a bad scale or rotation can make the screen hard to use.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Breadway/bos-settings#28
No description provided.