Refocus focused window for focus in events on the root window. (#3543)

This deals with (admittedly somewhat misbehaving) clients which
use XSetInputFocus to take focus, but then don't properly restore
focus. This has been observed with TK apps, but also, e.g., Steam.

Ported from a06e66982b by @psychon 

Fixes https://github.com/awesomeWM/awesome/issues/3379
This commit is contained in:
tuwuna 2022-01-22 18:28:24 +07:00 committed by GitHub
parent 21b908bef9
commit cd4008c249
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -696,6 +696,11 @@ event_handle_enternotify(xcb_enter_notify_event_t *ev)
static void
event_handle_focusin(xcb_focus_in_event_t *ev)
{
if (ev->event == globalconf.screen->root) {
/* Received focus in for root window, refocusing the focused window */
globalconf.focus.need_update = true;
}
if (ev->mode == XCB_NOTIFY_MODE_GRAB
|| ev->mode == XCB_NOTIFY_MODE_UNGRAB)
/* Ignore focus changes due to keyboard grabs */