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
Added option to stop cursor from following focused windows #765
Conversation
For now what i wanted for my personal use case have been addressed, but i'm looking forward to improve this. Also regarding the feeling of this addition, i made what was the most natural for me: the focus is recalculated when the cursor moves. But after looking at other window manager i noticed that it often changes focus only when a window is enter with the mouse. So i would like some feedback on which one could be the better option, and the most natural. Also i have no idea why, but changing to a tag will focus the window under the cursor, even if i modified this in |
Just started to get into this topic, but while answering questions on discord a thought came up: the reason why we have this is that in Coming back to your questions later, sorry for all those delays. |
The more I get into this, the more I get the feeling this should actually be a variant of the
Personally I think recalculating focus, when a window border is crossed is the most natural way, and I would expect it to be possibly a little less expensive.
🤔 I would have guessed, that the same as you have in |
Yes, it's only with
Ok this will be the way then. Thank you for the feedback, i'll implement this asap ! |
I finished tweaking the little things and i think it is now ready for merge. |
Reading on mobile this seems good to me. |
Description
A little feature that adds the
mouse_follows_focus
option that will decide if the cursor will follow windows as they're focused or not.Currently when you change the focused window, the cursor will be placed on the center of the newly created window, and that can sometimes be a bit annoying.
I can also lead to some problematic behaviors: for example when a window spawns a popup sub-window, and focusing the parent window forces you to focus the popup, the cursor would always teleport in the center of the popup when you try to escape it, and so your cursor would be stuck in the popup. This happened a lot to me with kde applications, such as kdenlive and krita.
I've discussed this feature idea briefly on discord a while ago, but didn't really went to try to implement it since then.
I couldn't find any related issue for this feature, let me know if one exists so i can reference it here.
This PR is just a draft, i couldn't finish it as fast as i would have liked it, so there is still stuff to do, and also I need others to see if the implementation is ok or needs more work.
The cursor will not teleport when:
Type of change
Updated user documentation:
to be edited here: https://github.com/leftwm/leftwm/wiki/Config#focus-behaviour
Focus Behaviour
LeftWM now has 3 focusing behaviours (Sloppy, ClickTo, and Driven) and 2 options (focus_new_windows, sloppy_mouse_follows_focus), which alter the way focus is handled.
These encompass 5 different patterns:
sloppy_mouse_follows_focus
option:true
, the cursor will follow the focus and teleport to the window that takes focus.false
, the cursor isn't moved by LeftWM at all.Default:
Note: This is only available in LeftWM >=0.2.8.
Checklist:
make test
locally with no errors or warnings reportedcargo clippy -- -W clippy::pedantic -A clippy::must_use_candidate -A clippy::cast_precision_loss -A clippy::cast_possible_truncation -A clippy::cast_possible_wrap -A clippy::cast_sign_loss -A clippy::mut_mut