Add option to disable exit-on-loss-of-keyboard-focus #128

Open
opened 4 months ago by carlo · 7 comments
carlo commented 4 months ago

I'm experiencing an issue whereby when the mouse pointer leaves the fuzzel window, fuzzel exits.

This happens both with version 1.7.0 and with the latest master branch (d1ef3abd4f).

I've tracked this down to getting a keyboard_leave() event, which sets seat->wayl->status = EXIT. That event is immediately followed by a keyboard_enter() event.

I'm not sure why this is happening, but it doesn't seem like intended behaviour.

I'm running sway 1.7 on Arch Linux.

I'm experiencing an issue whereby when the mouse pointer leaves the fuzzel window, fuzzel exits. This happens both with version 1.7.0 and with the latest master branch (d1ef3abd4feb75c6c54f137556e397e2462de78c). I've tracked this down to getting a `keyboard_leave()` event, which sets `seat->wayl->status = EXIT`. That event is immediately followed by a `keyboard_enter()` event. I'm not sure why this is happening, but it doesn't seem like intended behaviour. I'm running sway 1.7 on Arch Linux.
Owner

It's intended behavior to exit on keyboard focus loss. But if the compositor sends a keyboard leave event when the pointer leaves the window, that sounds like a compositor bug. Do you have "focus-follows-mouse" enabled in your compositor?

It's intended behavior to exit on keyboard focus loss. But if the compositor sends a keyboard leave event when the **pointer** leaves the window, that sounds like a compositor bug. Do you have "focus-follows-mouse" enabled in your compositor?
Poster

Ah indeed – it seems that sway defaults to focus_follows_mouse being enabled. When I disable it, this no longer happens (and I can see that no keyboard_enter() or keyboard_leave() events get triggered any more).

Ah indeed – it seems that sway defaults to `focus_follows_mouse` being enabled. When I disable it, this no longer happens (and I can see that no `keyboard_enter()` or `keyboard_leave()` events get triggered any more).
Poster

Hm, and when setting focus_follows_mouse always, it gets much worse – it then triggers the fatal keyboard_leave() callback as soon as the mouse pointer is moved in any way, as long as the pointer is outside of the fuzzel window. (Originally, it only happened when traversing from the window to outside the window.)

Hm, and when setting `focus_follows_mouse always`, it gets much worse – it then triggers the fatal `keyboard_leave()` callback as soon as the mouse pointer is moved in any way, as long as the pointer is outside of the fuzzel window. (Originally, it only happened when traversing from the window to outside the window.)
Poster

For reference, focus_follows_mouse is a tri-state setting, see docs:

focus_follows_mouse yes|no|always

If set to yes, moving your mouse over a window will focus that window. If set to always, the window under the cursor will always be focused, even after switching between workspaces.

For reference, `focus_follows_mouse` is a tri-state setting, see [docs](https://man.archlinux.org/man/sway.5): > **`focus_follows_mouse`** `yes|no|always` > > If set to `yes`, moving your mouse over a window will focus that window. If set to `always`, the window under the cursor will always be focused, even after switching between workspaces.
Owner

Well, both fuzzel and Sway is doing what they're supposed to be doing. Which means we have two options: either you disable focus-follows-mouse, or we add an option to fuzzel to not quit on loss of keyboard focus.

Well, both fuzzel and Sway is doing what they're supposed to be doing. Which means we have two options: either you disable focus-follows-mouse, or we add an option to fuzzel to not quit on loss of keyboard focus.
Poster

In practice, I can totally live with the behaviour I get with focus_follows_mouse yes, so it's not a big deal.

I think it might still be nice to implement the option you describe in fuzzel, especially for the benefit of users with focus_follows_mouse always.

In practice, I can totally live with the behaviour I get with `focus_follows_mouse yes`, so it's not a big deal. I think it might still be nice to implement the option you describe in fuzzel, especially for the benefit of users with `focus_follows_mouse always`.
dnkl added the
enhancement
label 4 months ago
dnkl changed title from fuzzel exits when mouse pointer leaves window to Add option to disable exit-on-loss-of-keyboard-focus 4 months ago

Perpahs sway+focus-follows-mouse should special-case windows created using wlr_layer_shell_unstable_v1.

Perpahs sway+focus-follows-mouse should special-case windows created using wlr_layer_shell_unstable_v1.
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: dnkl/fuzzel#128
Loading…
There is no content yet.