follow=keyboard: Fix regression where we don't fall back to mouse#1062
Conversation
Commit e8fc45d ("follow=keyboard: Fall back to follow=mouse instead of XDefaultScreen()", PR#708) introduced the behaviour that we fall back to follow=mouse if there is no focused client in order to accommodate for window managers where sitting on the root window is normalised, like dwm. Commmit ebcd20d ("Fix process of gettign the active monitor", PR#809) added support for multiple X screens on one display. However, it broke the functionality introduced in the previous PR, because explicitly focusing the root window results in XGetInputFocus() returning the root window, not PointerRoot. Fix this by explicitly checking if the focused window is the root window.
|
Cc: @mcz Noticed this for a little while now, but only recently had the time to dig in and find the cause. |
|
Thank you for your contribution. It'd be nice if @mcz could check if this doesn't regress their fixes. Otherwise, I'll take a look next week to review the code better. |
|
Doesn't look like it would break my patch. |
|
Thanks for reviewing mcz and thanks for the patch cdown. I'll merge this now. |
Commit e8fc45d ("follow=keyboard: Fall back to follow=mouse instead
of XDefaultScreen()", PR#708) introduced the behaviour that we fall
back to follow=mouse if there is no focused client in order to
accommodate for window managers where sitting on the root window is
normalised, like dwm.
Commmit ebcd20d ("Fix process of gettign the active monitor",
PR#809) added support for multiple X screens on one display. However, it
broke the functionality introduced in the previous PR, because
explicitly focusing the root window results in XGetInputFocus()
returning the root window, not PointerRoot.
Fix this by explicitly checking if the focused window is the root
window.