* window.c (Fdelete_window_internal): Invalidate the mouse highlight.
authorChong Yidong <cyd@gnu.org>
Sun, 12 Feb 2012 04:29:50 +0000 (12:29 +0800)
committerChong Yidong <cyd@gnu.org>
Sun, 12 Feb 2012 04:29:50 +0000 (12:29 +0800)
Fixes: debbugs:9904

src/ChangeLog
src/window.c

index cfbd29d..0ded1fc 100644 (file)
@@ -1,3 +1,8 @@
+2012-02-12  Chong Yidong  <cyd@gnu.org>
+
+       * window.c (Fdelete_window_internal): Invalidate the mouse
+       highlight (Bug#9904).
+
 2012-02-12  Glenn Morris  <rgm@gnu.org>
 
        * xselect.c (Fx_own_selection_internal)
index 3246894..95e7d8a 100644 (file)
@@ -3886,10 +3886,18 @@ Signal an error when WINDOW is the only window on its frame.  */)
       && EQ (r->new_total, (horflag ? r->total_cols : r->total_lines)))
     /* We can delete WINDOW now.  */
     {
+      Mouse_HLInfo *hlinfo;
+
       /* Block input.  */
       BLOCK_INPUT;
       window_resize_apply (p, horflag);
 
+      /* If this window is referred to by the dpyinfo's mouse
+        highlight, invalidate that slot to be safe (Bug#9904).  */
+      hlinfo = MOUSE_HL_INFO (XFRAME (w->frame));
+      if (EQ (hlinfo->mouse_face_window, window))
+       hlinfo->mouse_face_window = Qnil;
+
       windows_or_buffers_changed++;
       Vwindow_list = Qnil;
       FRAME_WINDOW_SIZES_CHANGED (f) = 1;