From bf72cf71eac834a46ed4d6e1755d7fd1ae57c104 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Mon, 11 Feb 2013 16:19:28 +0100 Subject: [PATCH] Refresh focus on FocusIn events To avoid some oddities, awesome sets the input focus lazily. Instead of immediately sending everything to the X11 server, awesome just sets a flag "have to update the focus later". However, this can cause problems. As Stefan noticed, awesome can forget about focus changes on FocusIn events when such an event comes in while we still have a pending focus change. The fix here is to send out the pending focus change before we record the fact that another client now acquired the input focus. Reported-By: Stefan Haller Signed-off-by: Uli Schlachter --- event.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/event.c b/event.c index af08cfd9..dfe046dd 100644 --- a/event.c +++ b/event.c @@ -524,8 +524,11 @@ event_handle_focusin(xcb_focus_in_event_t *ev) { client_t *c; - if((c = client_getbywin(ev->event))) + if((c = client_getbywin(ev->event))) { + /* If there is still a pending focus change, do it now. */ + client_focus_refresh(); client_focus_update(c); + } } /* all other events are ignored */ default: -- 2.11.4.GIT