Repository navigation
Add display layout preview with timed rollback - #14533
typhoon1217 wants to merge 1 commit into
Conversation
[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. FindingsSummaryAdds display arrangement and mode controls with a 20-second preview, automatic rollback, and guarded saves to
|
5ca36d4 to
975cba1
Compare
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.
975cba1 to
c479efb
Compare
| } | ||
|
|
||
| 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" |
There was a problem hiding this comment.
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.
| 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)) } |
There was a problem hiding this comment.
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.
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.
Workspace ownership is left to
default/hypr/monitor-workspaces.lua(#15655). Rebased ontoquattro(ce39c5e9); the earlier Workspaces tab was removed. It wrotehl.workspace_rulelines for each numbered workspace against a connector, which conflicts with per-monitor blocks:config.reloadedreconciliation would renumber the moved workspaces. The editor now never dispatches workspace moves or writes workspace rules, and the backend rejects any request key other thandisplays.Strings go through
Commons.I18nand are listed indefault/i18n/en/shell.json(displaySettings.*,monitor.advancedSettings), soextract-scan --checkpasses.Evidence
Isolated Hyprland 0.56.2, two headless 1920×1080 outputs, full shell from this branch, GUI-driven (Qt 6.11.2):
Preview: HEADLESS-1 placed below HEADLESS-2 (
1920x1080). The countdown shows.0x0and themonitors.luachecksum is unchanged.hl.monitorlines and nohl.workspace_rule. The layout surviveshyprctl reloadwith no config errors. The watchdog then reportsNo pending preview.The isolated session has no systemd user manager, so a stand-in launched the same watchdog command detached. Runtime record
Tests:
monitor-layout-test.sh(preview/keep/revert, races, reload mismatch; two-display Keep dispatches no workspace command and writes no workspace rule)monitor-layout-canvas-test.sh(qmltestrunner continuous drag)monitor-scaling,monitor,monitor-recovery,monitor-state,monitor-output-name,monitor-clamshell-scalehyprland-monitor-workspaces-test.shI18N_STRUCTURAL=1 i18n-test.sh,i18n-sync.py extract-scan --checkplugin-validate,qml-text-format,shell-ipc-displayNot verified: physical monitors, a VM, and reconciliation by
monitor-workspaces.luaafter 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 LAYOUTmarkers. Personal lines outside the block, and rules for unplugged outputs, are preserved. Deleting the block restores prior behavior.Blast Radius: displays
monitor-config.lock. External editors do not use it, so a conflicting edit is kept as.monitors.*instead of being silently lost.