Bspwm: focus_follow_mouse allows for incoherent states

Created on 29 Aug 2016  路  10Comments  路  Source: baskerville/bspwm

Hello,

I use focus_follow_mouse. If I have two windows A and B side-by-side like this:

|A|B|

and if I make A go fullscreen, move the cursor where B is and turn off fullscreen, what happens is that the cursor is on B but A is still focused, whereas I expected B to be focused. There are two options: either I move the mouse back-and-forth or I can enable click_to_focus, which still feels clunky. I'd like the click_to_focus option to have a more "intuitive" behavior, which would in this case make B focused.

The same behavior appears when changing desktops: if I put the mouse where A is, then switch to another desktop, move the mouse where B would be, and switch back to the previous workspace, A is focused, not B. I've also been able to reproduce this behavior with a floating window that can have its visibility toggled and that has part of its surface over A and the rest on B.

A possible solution could be adding code in the functions called when the user switches to another desktop, toggles fullscreen or changes a window's visibility that refreshes the focus, so to speak.

All 10 comments

you can read a bit about this here: https://github.com/baskerville/bspwm/commit/2b2ed4eb56c728c24f7e8c5a6b1d08ab0e2aea9c

A possible solution could be adding code in the functions called when the user switches to another desktop, toggles fullscreen or changes a window's visibility that refreshes the focus, so to speak.

perhaps you could achieve this via script, like so:

bspc subscribe node_state | while read line; do 
    bspc node -f pointed
done

@neeasade Might work for fullscreen, but doesn't work for desktops. Doing the same with desktop_focus works like a charm though:

bspc subscribe desktop_focus | while read line; do bspc node -f pointed; done

indeed, and don't forget you can subscribe to multiple events.

bspc subscribe desktop_focus node_state | ....

The suggestions are fine, but the question is if this should be the default behavior of bspwm when focus_follow_mouse is enabled?

The expected behaviour of focus_follows_pointer is definitely what you achieve by adding
bspc subscribe desktop_focus node_state node_geometry | while read -r line; do bspc node -f pointed; done &

I added node_geometry for the case

A|B
 |-
 |C

Say that I focused A and my pointer is on B, then I close B so my pointer is under C now and that window should be focused not A

Just started noticing this in bspwm 0.9.2, has it always had this behaviour?

The most common issue that I have is similiar to @kallith's. If I have my cursor on window1, and then move focus to window2 (using the keyboard), I cannot refocus window1 with the mouse unless I move the cursor off of window1 and then back on.

I experience the exact same thing as @Toqozz , after upgrading to 0.9.2. The bspc subscribe while loop does not fix that. Is this considered a bug?

If more data is needed, I'm happy to provide.

What is the status on this?

I'm working on a better implementation of the previous approach.

The FFP behavior is now back to how it was before 2b2ed4eb56c728c24f7e8c5a6b1d08ab0e2aea9c.

The original issue is in contradiction with #454.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ithamsteri picture ithamsteri  路  4Comments

Fnux picture Fnux  路  4Comments

Anachron picture Anachron  路  3Comments

JKomoroski picture JKomoroski  路  5Comments

rien333 picture rien333  路  5Comments