baskerville / bspwm

A tiling window manager based on binary space partitioning
BSD 2-Clause "Simplified" License
7.61k stars 420 forks source link

Fix gratuitous pointer jump #1481

Open falsifian opened 5 months ago

falsifian commented 5 months ago

I have pointer_follows_focus set. Normally when I focus a window by moving the pointer to it, the pointer doesn't warp, which is good: I only want it to warp when something else caused the focus to change. However, if the pointer crossed from one monitor to another, it would warp to the middle of the newly focussed window, which was annoying.

With some debugging I figured out focus_in was being triggered with e->event == root, causing focus_in to focus the focussed node a second time. I don't know enough about X to understand why this event was generated; perhaps a real fix would address that as the root issue (no pun intended).

Instead, this fix simply unsets pointer_follows_focus in this case. I briefly tested the repro instructions at https://github.com/baskerville/bspwm/issues/1378#issuecomment-1107700054 to confirm the original bug behind the code I modified did not come back.

falsifian commented 3 months ago

Ping. I've been using this patch since I posted it, along with #1480, and both seem to be working fine.