Fix monitor scaling toggle for multi-monitor setups#4778
Fix monitor scaling toggle for multi-monitor setups#4778tmn73 wants to merge 1 commit intobasecamp:devfrom
Conversation
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
7b45989 to
253c617
Compare
253c617 to
edb2395
Compare
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
edb2395 to
4643b23
Compare
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
+1, reproduces on my dual 1080p setup (HDMI-A-1 at |
|
Heads-up @tmn73 — this PR targets If you're around and want to rebase onto the renamed |
The cycle script passed `auto` as the monitor position to `hyprctl keyword monitor`, which makes Hyprland re-auto-place the monitor based on hardware detection order rather than its configured position. On multi-monitor setups this swaps monitor positions every time Super + / is pressed. Capture the monitor's current x,y from `hyprctl monitors -j` (already parsed into $MONITOR_INFO) and pass it explicitly so the layout stays stable. Closes basecamp#4785. A more comprehensive fix was proposed in basecamp#4778 against the pre-rename `-toggle` file, but has not been rebased.
|
On it
|
4643b23 to
68ee64e
Compare
|
Rebase is clean — diff is +41/-4 against the current Quick notes from reading the diff:
+1 on behalf of a user reproducing the bug. Thanks for the fast rebase @tmn73 — hope this lands soon. |
Preserve monitor positions when cycling display scales with Super+/ on multi-monitor setups. The original script used `auto` positioning which, at runtime via hyprctl keyword, uses hardware detection order (internal display first) rather than config order — swapping monitor positions. This fix: - Uses each monitor's current absolute position instead of `auto` - Repositions adjacent monitors to account for logical width changes - Uses absolute positioning to prevent cumulative drift across cycles - Orders operations to avoid overlap warnings (wider → move first, narrower → scale first) - Preserves current mode/refresh rate instead of `preferred` (which may pick a lower refresh rate) - Re-sources looknfeel.conf to restore layout settings reset by monitor reconfiguration
68ee64e to
df8b86b
Compare
Problem
On multi-monitor setups, using
Super+/to cycle monitor scaling causes several issues:Monitor positions swap. The script used
autofor position, which at runtime places monitors by hardware detection order (internal display first) rather than config order — swapping left/right.Mouse can't cross between monitors. Changing a monitor's scale changes its logical width (e.g. 2560px at 1x → 1600px at 1.6x), but adjacent monitors aren't repositioned — leaving a dead zone the mouse can't cross.
Window gaps and layout settings are lost.
hyprctl keyword monitorresets layout properties likegaps_in,gaps_out, border size, and rounding.Position drift after full cycle. Using relative deltas to reposition monitors causes cumulative drift (e.g. 53px after a 1x→1.6x→2x→3x→1x cycle) because Hyprland auto-adjusts positions between sequential commands.
Fix
x/yinstead ofauto.active_x + new_logical_width, then stack each subsequent monitor) to avoid drift from Hyprland's inter-command adjustments.width x height @ refreshRateinstead ofpreferred, which may select a lower refresh rate.looknfeel.confafter reconfiguration to restore gaps, borders, rounding, and other layout properties.Note
Only repositions monitors to the right of the active one. This covers the common layout (laptop + external to the right). Monitors to the left are unaffected.
Testing
Tested on a 2-monitor setup (external left at 2560x1440@360Hz + laptop right at 2560x1600@240Hz) through full scale cycles (1x → 1.6x → 2x → 3x → 1x) on both monitors. Positions return to exact original values after a full cycle, mouse movement works at every scale, no overlap warnings, and layout settings are preserved.