emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r110981: * alloc.c (Fgarbage_collect)


From: Dmitry Antipov
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r110981: * alloc.c (Fgarbage_collect): Unblock input after clearing
Date: Thu, 22 Nov 2012 13:32:32 +0400
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110981
committer: Dmitry Antipov <address@hidden>
branch nick: trunk
timestamp: Thu 2012-11-22 13:32:32 +0400
message:
  * alloc.c (Fgarbage_collect): Unblock input after clearing
  gc_in_progress to avoid note_mouse_highlight glitch with GC.
  * frame.h (FRAME_MOUSE_UPDATE): New macro.
  * msdos.c (IT_frame_up_to_date): Use it here...
  * w32term.c (w32_frame_up_to_date): ...here...
  * xterm.c (XTframe_up_to_date): ...and here...
  * nsterm.m (ns_frame_up_to_date): ...but not here.
  * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
  Adjust users.
  * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
  Do not check whether GC is in progress.
modified:
  src/ChangeLog
  src/alloc.c
  src/frame.h
  src/lisp.h
  src/msdos.c
  src/nsterm.m
  src/w32term.c
  src/xdisp.c
  src/xterm.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-11-22 06:52:30 +0000
+++ b/src/ChangeLog     2012-11-22 09:32:32 +0000
@@ -1,5 +1,19 @@
 2012-11-22  Dmitry Antipov  <address@hidden>
 
+       * alloc.c (Fgarbage_collect): Unblock input after clearing
+       gc_in_progress to avoid note_mouse_highlight glitch with GC.
+       * frame.h (FRAME_MOUSE_UPDATE): New macro.
+       * msdos.c (IT_frame_up_to_date): Use it here...
+       * w32term.c (w32_frame_up_to_date): ...here...
+       * xterm.c (XTframe_up_to_date): ...and here...
+       * nsterm.m (ns_frame_up_to_date): ...but not here.
+       * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
+       Adjust users.
+       * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
+       Do not check whether GC is in progress.
+
+2012-11-22  Dmitry Antipov  <address@hidden>
+
        * xdisp.c (window_buffer_changed): New function.
        (update_menu_bar, update_tool_bar): Use it to
        simplify large 'if' statements.

=== modified file 'src/alloc.c'
--- a/src/alloc.c       2012-11-21 21:06:52 +0000
+++ b/src/alloc.c       2012-11-22 09:32:32 +0000
@@ -5331,12 +5331,12 @@
   dump_zombies ();
 #endif
 
+  check_cons_list ();
+
+  gc_in_progress = 0;
+
   unblock_input ();
 
-  check_cons_list ();
-
-  gc_in_progress = 0;
-
   consing_since_gc = 0;
   if (gc_cons_threshold < GC_DEFAULT_THRESHOLD / 10)
     gc_cons_threshold = GC_DEFAULT_THRESHOLD / 10;

=== modified file 'src/frame.h'
--- a/src/frame.h       2012-11-12 16:02:46 +0000
+++ b/src/frame.h       2012-11-22 09:32:32 +0000
@@ -933,6 +933,21 @@
        && (frame_var = XCAR (list_var), 1));   \
        list_var = XCDR (list_var))
 
+/* Reflect mouse movement when a complete frame update is performed.  */
+
+#define FRAME_MOUSE_UPDATE(frame)                              \
+  do {                                                         \
+    Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (frame);              \
+    if (frame == hlinfo->mouse_face_mouse_frame)               \
+      {                                                                \
+       block_input ();                                         \
+       if (hlinfo->mouse_face_mouse_frame)                     \
+         note_mouse_highlight (hlinfo->mouse_face_mouse_frame, \
+                               hlinfo->mouse_face_mouse_x,     \
+                               hlinfo->mouse_face_mouse_y);    \
+       unblock_input ();                                       \
+      }                                                                \
+  } while (0)
 
 extern Lisp_Object Qframep, Qframe_live_p;
 extern Lisp_Object Qtty, Qtty_type;

=== modified file 'src/lisp.h'
--- a/src/lisp.h        2012-11-20 20:06:17 +0000
+++ b/src/lisp.h        2012-11-22 09:32:32 +0000
@@ -1649,10 +1649,6 @@
   int mouse_face_face_id;
   Lisp_Object mouse_face_overlay;
 
-  /* 1 if a mouse motion event came and we didn't handle it right away because
-     gc was in progress.  */
-  int mouse_face_deferred_gc;
-
   /* FRAME and X, Y position of mouse when last checked for
      highlighting.  X and Y can be negative or out of range for the frame.  */
   struct frame *mouse_face_mouse_frame;

=== modified file 'src/msdos.c'
--- a/src/msdos.c       2012-11-05 03:18:32 +0000
+++ b/src/msdos.c       2012-11-22 09:32:32 +0000
@@ -1275,7 +1275,6 @@
       hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
       hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
       hlinfo->mouse_face_window = Qnil;
-      hlinfo->mouse_face_deferred_gc = 0;
       hlinfo->mouse_face_mouse_frame = NULL;
     }
 
@@ -1295,21 +1294,10 @@
 static void
 IT_frame_up_to_date (struct frame *f)
 {
-  Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
   Lisp_Object new_cursor, frame_desired_cursor;
   struct window *sw;
 
-  if (hlinfo->mouse_face_deferred_gc
-      || (f && f == hlinfo->mouse_face_mouse_frame))
-    {
-      block_input ();
-      if (hlinfo->mouse_face_mouse_frame)
-       note_mouse_highlight (hlinfo->mouse_face_mouse_frame,
-                             hlinfo->mouse_face_mouse_x,
-                             hlinfo->mouse_face_mouse_y);
-      hlinfo->mouse_face_deferred_gc = 0;
-      unblock_input ();
-    }
+  FRAME_MOUSE_UPDATE (f);
 
   /* Set the cursor type to whatever they wanted.  In a minibuffer
      window, we want the cursor to appear only if we are reading input
@@ -1849,7 +1837,6 @@
            FRAME_BACKGROUND_PIXEL (SELECTED_FRAME ()) = colors[1];
        }
       the_only_display_info.mouse_highlight.mouse_face_mouse_frame = NULL;
-      the_only_display_info.mouse_highlight.mouse_face_deferred_gc = 0;
       the_only_display_info.mouse_highlight.mouse_face_beg_row =
        the_only_display_info.mouse_highlight.mouse_face_beg_col = -1;
       the_only_display_info.mouse_highlight.mouse_face_end_row =

=== modified file 'src/nsterm.m'
--- a/src/nsterm.m      2012-11-18 02:29:09 +0000
+++ b/src/nsterm.m      2012-11-22 09:32:32 +0000
@@ -1186,7 +1186,6 @@
       hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
       hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
       hlinfo->mouse_face_window = Qnil;
-      hlinfo->mouse_face_deferred_gc = 0;
       hlinfo->mouse_face_mouse_frame = 0;
     }
 
@@ -1887,8 +1886,7 @@
 ns_frame_up_to_date (struct frame *f)
 /* --------------------------------------------------------------------------
     External (hook): Fix up mouse highlighting right after a full update.
-    Some highlighting was deferred if GC was happening during
-    note_mouse_highlight (), while other highlighting was deferred for update.
+    Can't use FRAME_MOUSE_UPDATE due to ns_frame_begin and ns_frame_end calls.
    -------------------------------------------------------------------------- 
*/
 {
   NSTRACE (ns_frame_up_to_date);
@@ -1896,19 +1894,17 @@
   if (FRAME_NS_P (f))
     {
       Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
-      if ((hlinfo->mouse_face_deferred_gc || f 
==hlinfo->mouse_face_mouse_frame)
-      /*&& hlinfo->mouse_face_mouse_frame*/)
-        {
-          block_input ();
+      if (f == hlinfo->mouse_face_mouse_frame)
+       {
+         block_input ();
          ns_update_begin(f);
-          if (hlinfo->mouse_face_mouse_frame)
-            note_mouse_highlight (hlinfo->mouse_face_mouse_frame,
-                                  hlinfo->mouse_face_mouse_x,
-                                  hlinfo->mouse_face_mouse_y);
-          hlinfo->mouse_face_deferred_gc = 0;
+         if (hlinfo->mouse_face_mouse_frame)
+           note_mouse_highlight (hlinfo->mouse_face_mouse_frame,
+                                 hlinfo->mouse_face_mouse_x,
+                                 hlinfo->mouse_face_mouse_y);
          ns_update_end(f);
-          unblock_input ();
-        }
+         unblock_input ();
+       }
     }
 }
 
@@ -3869,7 +3865,6 @@
     dpyinfo->root_window = 42; /* a placeholder.. */
 
     hlinfo->mouse_face_mouse_frame = NULL;
-    hlinfo->mouse_face_deferred_gc = 0;
     hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
     hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
     hlinfo->mouse_face_face_id = DEFAULT_FACE_ID;

=== modified file 'src/w32term.c'
--- a/src/w32term.c     2012-11-12 04:00:55 +0000
+++ b/src/w32term.c     2012-11-22 09:32:32 +0000
@@ -723,21 +723,7 @@
 w32_frame_up_to_date (struct frame *f)
 {
   if (FRAME_W32_P (f))
-    {
-      Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
-
-      if (hlinfo->mouse_face_deferred_gc
-         || f == hlinfo->mouse_face_mouse_frame)
-       {
-         block_input ();
-         if (hlinfo->mouse_face_mouse_frame)
-           note_mouse_highlight (hlinfo->mouse_face_mouse_frame,
-                                 hlinfo->mouse_face_mouse_x,
-                                 hlinfo->mouse_face_mouse_y);
-         hlinfo->mouse_face_deferred_gc = 0;
-         unblock_input ();
-       }
-    }
+    FRAME_MOUSE_UPDATE (f);
 }
 
 
@@ -5979,7 +5965,6 @@
       hlinfo->mouse_face_end_row
        = hlinfo->mouse_face_end_col = -1;
       hlinfo->mouse_face_window = Qnil;
-      hlinfo->mouse_face_deferred_gc = 0;
       hlinfo->mouse_face_mouse_frame = 0;
     }
 

=== modified file 'src/xdisp.c'
--- a/src/xdisp.c       2012-11-22 06:52:30 +0000
+++ b/src/xdisp.c       2012-11-22 09:32:32 +0000
@@ -9642,7 +9642,7 @@
       do_pending_window_change (0);
       echo_area_display (1);
       do_pending_window_change (0);
-      if (FRAME_TERMINAL (f)->frame_up_to_date_hook != 0 && ! gc_in_progress)
+      if (FRAME_TERMINAL (f)->frame_up_to_date_hook)
        (*FRAME_TERMINAL (f)->frame_up_to_date_hook) (f);
     }
 }
@@ -9739,7 +9739,7 @@
       do_pending_window_change (0);
       echo_area_display (1);
       do_pending_window_change (0);
-      if (FRAME_TERMINAL (f)->frame_up_to_date_hook != 0 && ! gc_in_progress)
+      if (FRAME_TERMINAL (f)->frame_up_to_date_hook)
        (*FRAME_TERMINAL (f)->frame_up_to_date_hook) (f);
     }
 }
@@ -27685,12 +27685,6 @@
   if (hlinfo->mouse_face_defer)
     return;
 
-  if (gc_in_progress)
-    {
-      hlinfo->mouse_face_deferred_gc = 1;
-      return;
-    }
-
   /* Which window is that in?  */
   window = window_from_coordinates (f, x, y, &part, 1);
 

=== modified file 'src/xterm.c'
--- a/src/xterm.c       2012-11-12 04:00:55 +0000
+++ b/src/xterm.c       2012-11-22 09:32:32 +0000
@@ -669,21 +669,7 @@
 XTframe_up_to_date (struct frame *f)
 {
   if (FRAME_X_P (f))
-    {
-      Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
-
-      if (hlinfo->mouse_face_deferred_gc
-         || f == hlinfo->mouse_face_mouse_frame)
-       {
-         block_input ();
-         if (hlinfo->mouse_face_mouse_frame)
-           note_mouse_highlight (hlinfo->mouse_face_mouse_frame,
-                                 hlinfo->mouse_face_mouse_x,
-                                 hlinfo->mouse_face_mouse_y);
-         hlinfo->mouse_face_deferred_gc = 0;
-         unblock_input ();
-       }
-    }
+    FRAME_MOUSE_UPDATE (f);
 }
 
 
@@ -9502,7 +9488,6 @@
       hlinfo->mouse_face_end_row
        = hlinfo->mouse_face_end_col = -1;
       hlinfo->mouse_face_window = Qnil;
-      hlinfo->mouse_face_deferred_gc = 0;
       hlinfo->mouse_face_mouse_frame = 0;
     }
 
@@ -10153,7 +10138,6 @@
   dpyinfo->bitmaps_last = 0;
   dpyinfo->scratch_cursor_gc = 0;
   hlinfo->mouse_face_mouse_frame = 0;
-  hlinfo->mouse_face_deferred_gc = 0;
   hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
   hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
   hlinfo->mouse_face_face_id = DEFAULT_FACE_ID;


reply via email to

[Prev in Thread] Current Thread [Next in Thread]