Skip to content

overview: render windows correctly on non-origin monitors#188

Open
kanikamaxxing wants to merge 1 commit into
Axenide:mainfrom
kanikamaxxing:fix/multi-monitor-overview-asymmetric
Open

overview: render windows correctly on non-origin monitors#188
kanikamaxxing wants to merge 1 commit into
Axenide:mainfrom
kanikamaxxing:fix/multi-monitor-overview-asymmetric

Conversation

@kanikamaxxing
Copy link
Copy Markdown

Summary

On a multi-monitor setup where any monitor is positioned at a non-zero virtual-desktop offset, opening the overview on that monitor renders every window thumbnail outside its workspace cell — windows render at their global x position scaled down instead of at their monitor-local position.

Root cause is in AxctlService.qml's monitor mapping: it discards mon.metadata.x, mon.metadata.y, and mon.metadata.transform, so monitorData.x is undefined for every monitor. OverviewWindow.qml's let base = windowData.at[0] - monitorData.x falls back to 0, which only works for a monitor at the origin.

Changes

  • AxctlService.qml — extract x, y, transform from mon.metadata into the mapped monitor object (3 lines).
  • Overview.qml — drop the per-monitor window filter so each overview shows windows from every monitor, look up each window's own monitor for position math, and compute per-window scale as cell_width / window_monitor_width so cross-monitor windows fit their cell properly instead of being sized for the overview's monitor.
  • OverviewWindow.qml — after movetoworkspacesilent on drop, also dispatch moveworkspacetomonitor <ws> <drop_monitor> so windows dropped on monitor A's overview actually land on monitor A regardless of which monitor the workspace was previously bound to. Also adds the missing qs.modules.bar.workspaces import so the existing CompositorData.updateWindowList() call on drag finalize stops throwing ReferenceError.

Test plan

  • Dual-monitor setup (DP-1 2560×1440 at x=1920, DP-2 1920×1080 at x=0). Overview on DP-1 — windows render inside their cells, matching DP-2's already-correct behaviour.
  • Cross-monitor visibility: windows on DP-2 also show in DP-1's overview (and vice versa), each at correct per-monitor scale.
  • Drag a window in DP-1's overview, drop onto a workspace cell — window lands on DP-1's monitor.

Happy to iterate if anything here should land differently. Thanks!

— robin

The mapped monitor object in AxctlService discards mon.metadata.x/y/transform
so monitorData.x is undefined for every monitor. OverviewWindow's position math
falls back to 0, which works for the monitor at the origin but renders windows
on any other monitor outside the thumbnail bounds (the global window x is used
without the monitor offset subtracted).

Also drops the per-monitor window filter in Overview so each overview shows all
windows across monitors, and computes per-window scale from the window's own
monitor width so cross-monitor windows fit the cell properly instead of being
sized for the overview's monitor.

OverviewWindow now also pins the target workspace to the drop monitor after
movetoworkspacesilent, so drops on cells in monitor A's overview actually land
on monitor A regardless of where the workspace currently lives. And imports
qs.modules.bar.workspaces so the existing CompositorData reference on drag
finalize stops throwing ReferenceError.

Repro for the primary bug: dual-monitor setup with monitors at non-zero offsets.
The overview on the second monitor renders all window thumbnails outside their
cell because monitorData.x is undefined and global x positions are used as-is.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant