Skip to content

Add display layout preview with timed rollback - #14533

Closed
typhoon1217 wants to merge 1 commit into
omacom:quattrofrom
typhoon1217:feat/display-layout-editor
Closed

typhoon1217 wants to merge 1 commit into
omacom:quattrofrom
typhoon1217:feat/display-layout-editor

Conversation

@typhoon1217

@typhoon1217 typhoon1217 commented Oct 8, 2026 •

Copy link
Copy Markdown

Summary

The Display popup can change scaling but cannot arrange screens or change their mode. A settings icon in its header opens Arrangement / Displays. A change is applied as a 20-second preview, and an independent rollback service reverts it unless you keep it.

<Display panel> (shell/plugins/panels/monitor/Panel.qml)
  [Advanced settings] → omarchy-shell shell summon omarchy.display-settings
<Display settings> (shell/plugins/panels/display-settings/)
  Arrangement   drag + edge snap, exact X/Y, place left/right/above/below
  Displays      resolution, supported refresh rate, orientation
  Preview → omarchy-monitor-layout preview  (systemd-run watchdog: revert after 20 s)
  Keep    → marked block in ~/.config/hypr/monitors.lua, reload, verify geometry
  Revert  → restore the captured layout

Workspace ownership is left to default/hypr/monitor-workspaces.lua (#15655). Rebased onto quattro (ce39c5e9); the earlier Workspaces tab was removed. It wrote hl.workspace_rule lines for each numbered workspace against a connector, which conflicts with per-monitor blocks: config.reloaded reconciliation would renumber the moved workspaces. The editor now never dispatches workspace moves or writes workspace rules, and the backend rejects any request key other than displays.

Strings go through Commons.I18n and are listed in default/i18n/en/shell.json (displaySettings.*, monitor.advancedSettings), so extract-scan --check passes.

Display panel settings action

Evidence

Isolated Hyprland 0.56.2, two headless 1920×1080 outputs, full shell from this branch, GUI-driven (Qt 6.11.2):

  • Before: before
    Preview: HEADLESS-1 placed below HEADLESS-2 (1920x1080). The countdown shows.
    preview
  • Timed rollback: after 20 s, HEADLESS-1 is back at 0x0 and the monitors.lua checksum is unchanged.
    reverted
  • Keep: the marked block holds two hl.monitor lines and no hl.workspace_rule. The layout survives hyprctl reload with no config errors. The watchdog then reports No pending preview.
    kept

The isolated session has no systemd user manager, so a stand-in launched the same watchdog command detached. Runtime record

Tests:

Check Result
monitor-layout-test.sh (preview/keep/revert, races, reload mismatch; two-display Keep dispatches no workspace command and writes no workspace rule) 23 ok
monitor-layout-canvas-test.sh (qmltestrunner continuous drag) pass
monitor-scaling, monitor, monitor-recovery, monitor-state, monitor-output-name, monitor-clamshell-scale pass
hyprland-monitor-workspaces-test.sh 14 ok
I18N_STRUCTURAL=1 i18n-test.sh, i18n-sync.py extract-scan --check pass, 0 candidates
plugin-validate, qml-text-format, shell-ipc-display pass

Not verified: physical monitors, a VM, and reconciliation by monitor-workspaces.lua after Keep (the isolated compositor does not load Omarchy's Hyprland config).

Overlaps #7152 (drag arrangement), #13905 (relative placement) and #14436 (display selection/orientation). The difference here is a recoverable preview plus guarded persistence. Following the #6363 review, geometry changes are explicit user edits with no automatic reflow.

Merge Danger

Door: two-way

Rules live only between -- BEGIN/END OMARCHY DISPLAY LAYOUT markers. Personal lines outside the block, and rules for unplugged outputs, are preserved. Deleting the block restores prior behavior.

Blast Radius: displays

  • A wrong Keep repositions screens until edited. Keep re-checks runtime geometry after reload and restores on mismatch.
  • Arrow-key monitor navigation (Give each monitor its own workspaces #15655) needs shared edges. Edge snapping helps, but a manual gap still breaks neighbor movement.
  • Layout and the scaling shortcut share monitor-config.lock. External editors do not use it, so a conflicting edit is kept as .monitors.* instead of being silently lost.

@typhoon1217 typhoon1217 changed the title Add display layout editor with rotation, refresh rates and workspace assignments Add display settings popup with arrangement, modes and workspace assignment Oct 8, 2026
@typhoon1217 typhoon1217 changed the title Add display settings popup with arrangement, modes and workspace assignment Add display layout preview with timed rollback Oct 8, 2026
@typhoon1217
typhoon1217 marked this pull request as ready for review October 12, 2026 07:12
@greptile-apps

greptile-apps Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 3/5

[Medium impact] The PR affects display layout controls and saved monitor settings for users of the desktop shell.

Fix scaling persistence and stale dropdown values before merging.

Findings

  1. P1 Scaling changes vanish on reload ▶
  2. P1 Dropdowns show stale settings ▶

Summary

Adds display arrangement and mode controls with a 20-second preview, automatic rollback, and guarded saves to monitors.lua.

  • Display changes can be previewed, kept, or automatically restored.
  • The Display popup opens a separate editor for layout and display modes.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Display popup] --> B[Display settings]
  B --> C[Preview]
  C --> D[Capture current layout]
  D --> E[Start rollback service]
  E --> F[Apply requested layout]
  F --> G{User chooses}
  G -->|Keep| H[Save marked monitor rules]
  H --> I[Reload and check layout]
  G -->|Revert or timeout| J[Restore captured layout]
  I -->|Mismatch| J
  I -->|Matches| K[Clear pending preview]
Loading

Reviews (4) · Last reviewed commit: "feat(shell): add display layout editor w..." · Reviewed by Greptile

Comment thread bin/omarchy-monitor-layout Resolved
Comment thread test/shell.d/monitor-layout-test.sh Resolved
@omarchybot omarchybot added the enhancement New feature or request label Oct 16, 2026
@typhoon1217
typhoon1217 force-pushed the feat/display-layout-editor branch from 5ca36d4 to 975cba1 Compare October 21, 2026 00:55
Arrange displays and choose modes and orientation from the Display popup.
Preview applies the change for 20 seconds; Keep saves a marked block of
monitor rules in monitors.lua, and an independent user service reverts an
unconfirmed preview. Workspace ownership stays with monitor-workspaces.
@typhoon1217
typhoon1217 force-pushed the feat/display-layout-editor branch from 975cba1 to c479efb Compare October 21, 2026 00:56
}

monitor_code() {
jq -r '.displays[] | "hl.monitor({ output = \(.name | tojson), mode = \(.mode | tojson), position = \(( (.x|tostring) + "x" + (.y|tostring)) | tojson), scale = \(.scale), transform = \(.transform), disabled = false })"' "$1"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Scaling changes vanish on reload

After Keep, the generated per-display rules pin each screen's scale. The scaling shortcut still saves only omarchy_monitor_scale or the catch-all rule. Its change works immediately but disappears on the next config reload or login because the saved per-display scale takes precedence.

Update the saved per-display rule when scaling a screen managed by the layout editor.

Comment on lines +213 to +220
value: root.display ? String(root.display.transform) : "0"
options: [
{value: "0", label: Commons.I18n.t("displaySettings.landscape")},
{value: "1", label: Commons.I18n.t("displaySettings.portrait90")},
{value: "2", label: Commons.I18n.t("displaySettings.landscape180")},
{value: "3", label: Commons.I18n.t("displaySettings.portrait270")}
]
onChanged: function(value) { root.change("transform", Number(value)) }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Dropdowns show stale settings

The editor's dropdowns stop following the selected screen after their first use. Dropdown.selectCurrent() assigns value before emitting changed, which removes the value: binding here. Choose an orientation, then select another screen or Reset: the dropdown still shows the old choice even though Preview uses the current model. The same problem affects the screen, resolution, and refresh-rate dropdowns.

Restore the bindings after selection, or use dropdowns that do not overwrite their bound values.

@typhoon1217 typhoon1217 closed this Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants