overview: render windows correctly on non-origin monitors#188
Open
kanikamaxxing wants to merge 1 commit into
Open
overview: render windows correctly on non-origin monitors#188kanikamaxxing wants to merge 1 commit into
kanikamaxxing wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
xposition scaled down instead of at their monitor-local position.Root cause is in
AxctlService.qml's monitor mapping: it discardsmon.metadata.x,mon.metadata.y, andmon.metadata.transform, somonitorData.xis undefined for every monitor.OverviewWindow.qml'slet base = windowData.at[0] - monitorData.xfalls back to0, which only works for a monitor at the origin.Changes
AxctlService.qml— extractx,y,transformfrommon.metadatainto 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 ascell_width / window_monitor_widthso cross-monitor windows fit their cell properly instead of being sized for the overview's monitor.OverviewWindow.qml— aftermovetoworkspacesilenton drop, also dispatchmoveworkspacetomonitor <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 missingqs.modules.bar.workspacesimport so the existingCompositorData.updateWindowList()call on drag finalize stops throwingReferenceError.Test plan
Happy to iterate if anything here should land differently. Thanks!
— robin