changeset 53061:4835b200fafe

* xterm.c (x_detect_focus_change): Do not change focus frame for Enter/LeaveNotify if the current focus frame has explicit focus.
author Jan Djärv <jan.h.d@swipnet.se>
date Fri, 14 Nov 2003 19:13:02 +0000
parents 0327b225b8d0
children be7088df924d
files src/ChangeLog src/xterm.c
diffstat 2 files changed, 21 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Fri Nov 14 16:23:37 2003 +0000
+++ b/src/ChangeLog	Fri Nov 14 19:13:02 2003 +0000
@@ -1,3 +1,8 @@
+2003-11-14  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
+
+	* xterm.c (x_detect_focus_change): Do not change focus frame for
+	Enter/LeaveNotify if the current focus frame has explicit focus.
+
 2003-11-14  Kim F. Storm  <storm@cua.dk>
 
 	* dispnew.c (update_text_area): Fix redisplay error when hscroll
--- a/src/xterm.c	Fri Nov 14 16:23:37 2003 +0000
+++ b/src/xterm.c	Fri Nov 14 19:13:02 2003 +0000
@@ -3209,16 +3209,22 @@
     {
     case EnterNotify:
     case LeaveNotify:
-      if (event->xcrossing.detail != NotifyInferior
-          && event->xcrossing.focus
-          && ! (frame->output_data.x->focus_state & FOCUS_EXPLICIT))
-        nr_events = x_focus_changed ((event->type == EnterNotify
-                                      ? FocusIn : FocusOut),
-                                     FOCUS_IMPLICIT,
-                                     dpyinfo,
-                                     frame,
-                                     bufp,
-                                     numchars);
+      {
+        struct frame *focus_frame = dpyinfo->x_focus_event_frame;
+        int focus_state
+          = focus_frame ? focus_frame->output_data.x->focus_state : 0;
+
+        if (event->xcrossing.detail != NotifyInferior
+            && event->xcrossing.focus
+            && ! (focus_state & FOCUS_EXPLICIT))
+          nr_events = x_focus_changed ((event->type == EnterNotify
+                                        ? FocusIn : FocusOut),
+                                       FOCUS_IMPLICIT,
+                                       dpyinfo,
+                                       frame,
+                                       bufp,
+                                       numchars);
+      }
       break;
 
     case FocusIn: