Skip to content

Conversation

@iexavl
Copy link

@iexavl iexavl commented Nov 5, 2025

Hello! I just want to say I love what you are doing with this desktop environment.

I often use keyboard shortcuts to navigate around the system both in floating and tiling so I couldn't help but notice the odd priorities when the compositor has to choose which window should be focused next.

Right now the compositor chooses the next window to focus based on which is the closest window along the relevant axis (X for right and left, Y for up and down)
But this is clunky, because that position is on the opposite end of the current window, so for example if we are trying to focus to the right window of the current one, we end up choosing the window that's closest to the left border of the current window instead of the window that's closest to the right border of the current window. This leads to behavior like two windows that are seemingly perfectly next to each other, you want to switch focus, and a small window from under pops up.
image

image

I changed this to prioritize windows that are closer to the relevant border on the relevant axis.
So if we take the example with the right window again it goes something like this:
Prioritize the window whose X position is closest to the right border on the right side of the right border.
i.e: min(other.X - (current.X + current.width) ) // where this is > 0
If there is no window that matches that, looks for the window whose X position is closest to the right border on the left side of the right border.
i.e: max(other.X - (current.X + current.width)) // where this is < 0

@Drakulix Drakulix requested a review from a team November 5, 2025 18:08
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