[dev] DWM Mouse Focus Issue (Multiple screens regain keyboard focus)

From: Eric Mullins <esm15_AT_students.uwf.edu>
Date: Fri, 23 May 2014 21:11:02 -0500

Hello

I am having an issue with vanilla DWM and multiple screen's. When the
mouse leaves and re-enters a particular screen, the keyboard does not
focus where the mouse is pointing.

So if the mouse is in Screen2, Window1 and then goes over to the
Screen1 to the left, when coming back to Screen2, Window1 there is now
no keyboard input, with either click or sloppy focus. To regain
keyboard input the mouse has to either go into Screen2, Window 2 (if
there is one) or go to another desktop tab in that screen session.
The mouse does function properly, other than the focus for keyboard.
The keyboard actually remains focused in Screen1 although the mouse is
now in Screen2, Window1 which is very confusing and problematic.

          Screen1 Screen2
********************** ****************************
* * * Window1 | Window2 *
* * * | *
* * * | *
* * * | *
* * * | *
********************** ****************************

The issue is very similar to
https://bbs.archlinux.org/viewtopic.php?id=158780 , in which the
keyboard focus does not automatically go to the window in which the
mouse is hovering after switching tabs with multiple windows. The
patch posted by Vain fixes that particular focus issue when switching
tabs as expected.

The patch they used for the similar issue appends to the view() function:
( https://github.com/vain/dwm-vain/commit/3ef9abc023e4e34da41f586e70a99db15a7ae03d
)

XQueryPointer(dpy, root, &dummy, &win, &di, &di, &di, &di, &dui);
focus(wintoclient(win));
XFlush(dpy);

The issue here seems similar, however with multiple screens. It
seems to me that when mouse focus leaves it is deactivated, and comes
back in the same region it is not properly reactivated. In the prior
situation desktop tabs and same window region and in this situation
leaving the current screen area and coming back in the same region.
Received on Sat May 24 2014 - 04:11:02 CEST

This archive was generated by hypermail 2.3.0 : Sat May 24 2014 - 04:12:20 CEST