]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix minor thinko in focus tracking logic
authorPo Lu <luangruo@yahoo.com>
Wed, 21 Sep 2022 06:23:13 +0000 (14:23 +0800)
committerPo Lu <luangruo@yahoo.com>
Wed, 21 Sep 2022 06:23:13 +0000 (14:23 +0800)
* src/xterm.c (xi_handle_focus_change): Prefer explicit focus to
implicit focus.

src/xterm.c

index 59cde718d09009fc7b09bf64fc83bad371573aff..97c070736c215a94c32106bed67da3fdc4f40be8 100644 (file)
@@ -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;