the-cavalry / light-locker

A simple session-locker for lightdm
GNU General Public License v2.0
224 stars 22 forks source link

Unresponsive desktop after unlock #120

Open divVerent opened 5 years ago

divVerent commented 5 years ago

When light-locker starts while input is already grabbed, it tries to force the grab like this:

https://github.com/the-cavalry/light-locker/blob/master/src/gs-grab-x11.c#L498

        XSetInputFocus (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), None, RevertToNone, CurrentTime);

The direct consequence of this is:

However, this also has some unintended consequences:

(BTW in the concrete case this has been caused by running another screen locker [doesn't matter which one, reproduced using slock and xsecurelock] inside Xfce4 while not knowing that light-locker was enabled too; of course that was clearly misconfiguration but nevertheless there are more situations causing this and it's simply never a good thing to happen)

In fact, ICCCM even says about XSetInputFocus:

Clients that set the input focus need to decide a value for the revert-to field of the SetInputFocus request. This determines the behavior of the input focus if the window the focus has been set to becomes not viewable. The value can be any of the following: [...] None - Using this value causes problems if the window manager reparents the window, as most window managers will, and then crashes. The input focus will be None, and there will probably be no way to change it.

Note that neither PointerRoot nor None is really safe to use.

I suggest one or more of the following fixes: