]> git.sur5r.net Git - i3/i3lock/commit
SetInputFocus to the i3lock window to force-close context menus (#155)
authorMichael Stapelberg <stapelberg@users.noreply.github.com>
Sun, 22 Oct 2017 20:16:34 +0000 (22:16 +0200)
committerGitHub <noreply@github.com>
Sun, 22 Oct 2017 20:16:34 +0000 (22:16 +0200)
commit5b4d45a8aff1dacaad364ae6df70c3a6a5067701
tree180f42e67409ea5bdc9f92a8d75c1aecea1c7925
parentd3636246de11a02bb0d79808436c1edfe80d406b
SetInputFocus to the i3lock window to force-close context menus (#155)

When grabbing the pointer/keyboard fails, a new code path is activated, which:

1. Uses the standards-compliant _NET_ACTIVE_WINDOW root window property to
   determine the window to restore focus to.

2. Sets the input focus to the i3lock window, thereby possibly force-closing
   open context menus (works with e.g. Google Chrome, does not work with
   e.g. thunar, gedit).

3. Upon exiting, restores focus to the window from step ① by sending a
   _NET_ACTIVE_WINDOW ClientMessage to the root window. Note that this step
   requires https://github.com/i3/i3/pull/3027 in i3 to not mess up focus.

fixes https://github.com/i3/i3lock/issues/35
i3lock.c
xcb.c
xcb.h