Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving the focusdir patch #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Improving the focusdir patch #23

wants to merge 1 commit into from

Conversation

jzbor
Copy link

@jzbor jzbor commented Mar 2, 2021

I was bothered by it switching always to the top of the stack. So now it always switches to the last focused window if multiple windows have the same horizontal (vertical) distance and are not in a monocle/deck/similar layout.

@jzbor
Copy link
Author

jzbor commented Mar 2, 2021

Hm I have some problems with floating windows, but I am not quiet sure if thats up to my changes, as they should not affect those windows anyway...

@bakkeby
Copy link
Owner

bakkeby commented Mar 2, 2021

I'm not sure how these changes make any difference. The dist variable is hardcoded as 3000000 so this will only have an effect if the client_dist happens to also be calculated as 3000000. What am I missing?

If the currently selected client is floating then focusdir will try to select the next floating client in a given direction.
If the currently selected client is tiled then focusdir will try to select the next tiled client in a given direction.

It is complicated to do this properly when windows are overlapping (floating windows or fake floating master layouts).

I'd say that there is definitely room for improvement with regards to this patch so thank you for looking into it.

@jzbor
Copy link
Author

jzbor commented Mar 2, 2021

So for the initial dist value I just chose a ridiculously high number so that it does not coincidentally trigger (which may be possible if you would take for example '0'. I am not entirely sure if this is necessary. Of cause you could add a check if the variable is initialized and leave it uninitialized, but this seemed like the easiest way to do it. Admittedly not the most beautiful way.

I see your problem with floating windows. I think I'll try considering only the upper right corner. I think for me personally that would work fine. Of course for non-programmers this might not be intuitive.

@jzbor
Copy link
Author

jzbor commented Mar 2, 2021

I think I'll try considering only the upper right corner.

Ok nvm I think I have no idea on how to do that...

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.

2 participants