From df79a23da7ac5664ae83b8a05dc725f0a3f20ac3 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Wed, 21 Sep 2022 14:23:13 +0800 Subject: [PATCH] Fix minor thinko in focus tracking logic * src/xterm.c (xi_handle_focus_change): Prefer explicit focus to implicit focus. --- src/xterm.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/xterm.c b/src/xterm.c index 59cde718d09..97c070736c2 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -12647,9 +12647,11 @@ xi_handle_focus_change (struct x_display_info *dpyinfo) else dpyinfo->client_pointer_device = device->device_id; } - - if (device->focus_implicit_frame - && device->focus_implicit_time > time) + /* Even if the implicit focus was set after the explicit focus + on this specific device, the explicit focus is what really + matters. So use it instead. */ + else if (device->focus_implicit_frame + && device->focus_implicit_time > time) { new = device->focus_implicit_frame; time = device->focus_implicit_time; -- 2.39.2