fix(hyprland): sort toplevels by x/y coordinates to fix workspace widget ordering in dynamic layouts#2094
Merged
Ly-sec merged 1 commit intonoctalia-dev:mainfrom Mar 11, 2026
Merged
Conversation
…ng in scrolling and master layouts
Collaborator
|
Hey @rivera-diego , I just tested it and it's seemingly working fine. Thank you very much! |
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.
Bug In Hyprland, when using dynamic tiling layouts that aren't purely chronological (like Master Layout or the new Scrolling Layout), the Workspaces widget displays the application icons out of order compared to their physical placement on the screen. This happens because Hyprland.toplevels.values returns the windows in an unstructured order, usually chronologically based on focus history.
Fix This PR modifies
HyprlandService.qml
to:
Safely extract the geometric x and y coordinates directly from the raw IPC data (lastIpcObject.at), falling back to standard variables.
Introduce a toSortedWindowList manual fallback mapping function right before the return iteration.
Sort the matrix based on Spatial representation: workspace first, then X coordinates (left to right), then Y coordinates (top to bottom).
The new automatic parsing in v4.6.0 handles the raw events gorgeously, but chaining it with this geometric sorting creates a bullet-proof, 1:1 screen representation on the Workspaces widget.