aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDmitry Antipov2012-11-22 13:32:32 +0400
committerDmitry Antipov2012-11-22 13:32:32 +0400
commit5c74767510841c8afc35f66f5cb068fe99f29615 (patch)
treebc21f52790ac994e4d635b5d13f1947e0f61fed3 /src
parent0e70ce9335996bd21c6b7f4ae0bf6b2924b89d4f (diff)
downloademacs-5c74767510841c8afc35f66f5cb068fe99f29615.tar.gz
emacs-5c74767510841c8afc35f66f5cb068fe99f29615.zip
* 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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog14
-rw-r--r--src/alloc.c4
-rw-r--r--src/frame.h15
-rw-r--r--src/lisp.h4
-rw-r--r--src/msdos.c15
-rw-r--r--src/nsterm.m25
-rw-r--r--src/w32term.c17
-rw-r--r--src/xdisp.c10
-rw-r--r--src/xterm.c18
9 files changed, 46 insertions, 76 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 4a4572bdd63..2e485f1b87b 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,19 @@
12012-11-22 Dmitry Antipov <dmantipov@yandex.ru> 12012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
2 2
3 * alloc.c (Fgarbage_collect): Unblock input after clearing
4 gc_in_progress to avoid note_mouse_highlight glitch with GC.
5 * frame.h (FRAME_MOUSE_UPDATE): New macro.
6 * msdos.c (IT_frame_up_to_date): Use it here...
7 * w32term.c (w32_frame_up_to_date): ...here...
8 * xterm.c (XTframe_up_to_date): ...and here...
9 * nsterm.m (ns_frame_up_to_date): ...but not here.
10 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
11 Adjust users.
12 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
13 Do not check whether GC is in progress.
14
152012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
16
3 * xdisp.c (window_buffer_changed): New function. 17 * xdisp.c (window_buffer_changed): New function.
4 (update_menu_bar, update_tool_bar): Use it to 18 (update_menu_bar, update_tool_bar): Use it to
5 simplify large 'if' statements. 19 simplify large 'if' statements.
diff --git a/src/alloc.c b/src/alloc.c
index 46b2dde93a3..28c9b51dab4 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -5331,12 +5331,12 @@ See Info node `(elisp)Garbage Collection'. */)
5331 dump_zombies (); 5331 dump_zombies ();
5332#endif 5332#endif
5333 5333
5334 unblock_input ();
5335
5336 check_cons_list (); 5334 check_cons_list ();
5337 5335
5338 gc_in_progress = 0; 5336 gc_in_progress = 0;
5339 5337
5338 unblock_input ();
5339
5340 consing_since_gc = 0; 5340 consing_since_gc = 0;
5341 if (gc_cons_threshold < GC_DEFAULT_THRESHOLD / 10) 5341 if (gc_cons_threshold < GC_DEFAULT_THRESHOLD / 10)
5342 gc_cons_threshold = GC_DEFAULT_THRESHOLD / 10; 5342 gc_cons_threshold = GC_DEFAULT_THRESHOLD / 10;
diff --git a/src/frame.h b/src/frame.h
index 35cbc44becc..87c4fcb0555 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -933,6 +933,21 @@ typedef struct frame *FRAME_PTR;
933 && (frame_var = XCAR (list_var), 1)); \ 933 && (frame_var = XCAR (list_var), 1)); \
934 list_var = XCDR (list_var)) 934 list_var = XCDR (list_var))
935 935
936/* Reflect mouse movement when a complete frame update is performed. */
937
938#define FRAME_MOUSE_UPDATE(frame) \
939 do { \
940 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (frame); \
941 if (frame == hlinfo->mouse_face_mouse_frame) \
942 { \
943 block_input (); \
944 if (hlinfo->mouse_face_mouse_frame) \
945 note_mouse_highlight (hlinfo->mouse_face_mouse_frame, \
946 hlinfo->mouse_face_mouse_x, \
947 hlinfo->mouse_face_mouse_y); \
948 unblock_input (); \
949 } \
950 } while (0)
936 951
937extern Lisp_Object Qframep, Qframe_live_p; 952extern Lisp_Object Qframep, Qframe_live_p;
938extern Lisp_Object Qtty, Qtty_type; 953extern Lisp_Object Qtty, Qtty_type;
diff --git a/src/lisp.h b/src/lisp.h
index 4817c6eb990..419176d06c8 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1649,10 +1649,6 @@ typedef struct {
1649 int mouse_face_face_id; 1649 int mouse_face_face_id;
1650 Lisp_Object mouse_face_overlay; 1650 Lisp_Object mouse_face_overlay;
1651 1651
1652 /* 1 if a mouse motion event came and we didn't handle it right away because
1653 gc was in progress. */
1654 int mouse_face_deferred_gc;
1655
1656 /* FRAME and X, Y position of mouse when last checked for 1652 /* FRAME and X, Y position of mouse when last checked for
1657 highlighting. X and Y can be negative or out of range for the frame. */ 1653 highlighting. X and Y can be negative or out of range for the frame. */
1658 struct frame *mouse_face_mouse_frame; 1654 struct frame *mouse_face_mouse_frame;
diff --git a/src/msdos.c b/src/msdos.c
index dd05a8b2c5d..433bf1074d8 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -1275,7 +1275,6 @@ IT_update_begin (struct frame *f)
1275 hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; 1275 hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
1276 hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; 1276 hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
1277 hlinfo->mouse_face_window = Qnil; 1277 hlinfo->mouse_face_window = Qnil;
1278 hlinfo->mouse_face_deferred_gc = 0;
1279 hlinfo->mouse_face_mouse_frame = NULL; 1278 hlinfo->mouse_face_mouse_frame = NULL;
1280 } 1279 }
1281 1280
@@ -1295,21 +1294,10 @@ IT_update_end (struct frame *f)
1295static void 1294static void
1296IT_frame_up_to_date (struct frame *f) 1295IT_frame_up_to_date (struct frame *f)
1297{ 1296{
1298 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
1299 Lisp_Object new_cursor, frame_desired_cursor; 1297 Lisp_Object new_cursor, frame_desired_cursor;
1300 struct window *sw; 1298 struct window *sw;
1301 1299
1302 if (hlinfo->mouse_face_deferred_gc 1300 FRAME_MOUSE_UPDATE (f);
1303 || (f && f == hlinfo->mouse_face_mouse_frame))
1304 {
1305 block_input ();
1306 if (hlinfo->mouse_face_mouse_frame)
1307 note_mouse_highlight (hlinfo->mouse_face_mouse_frame,
1308 hlinfo->mouse_face_mouse_x,
1309 hlinfo->mouse_face_mouse_y);
1310 hlinfo->mouse_face_deferred_gc = 0;
1311 unblock_input ();
1312 }
1313 1301
1314 /* Set the cursor type to whatever they wanted. In a minibuffer 1302 /* Set the cursor type to whatever they wanted. In a minibuffer
1315 window, we want the cursor to appear only if we are reading input 1303 window, we want the cursor to appear only if we are reading input
@@ -1849,7 +1837,6 @@ internal_terminal_init (void)
1849 FRAME_BACKGROUND_PIXEL (SELECTED_FRAME ()) = colors[1]; 1837 FRAME_BACKGROUND_PIXEL (SELECTED_FRAME ()) = colors[1];
1850 } 1838 }
1851 the_only_display_info.mouse_highlight.mouse_face_mouse_frame = NULL; 1839 the_only_display_info.mouse_highlight.mouse_face_mouse_frame = NULL;
1852 the_only_display_info.mouse_highlight.mouse_face_deferred_gc = 0;
1853 the_only_display_info.mouse_highlight.mouse_face_beg_row = 1840 the_only_display_info.mouse_highlight.mouse_face_beg_row =
1854 the_only_display_info.mouse_highlight.mouse_face_beg_col = -1; 1841 the_only_display_info.mouse_highlight.mouse_face_beg_col = -1;
1855 the_only_display_info.mouse_highlight.mouse_face_end_row = 1842 the_only_display_info.mouse_highlight.mouse_face_end_row =
diff --git a/src/nsterm.m b/src/nsterm.m
index 57d32ee0528..25eb7ebc495 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -1186,7 +1186,6 @@ x_free_frame_resources (struct frame *f)
1186 hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; 1186 hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
1187 hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; 1187 hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
1188 hlinfo->mouse_face_window = Qnil; 1188 hlinfo->mouse_face_window = Qnil;
1189 hlinfo->mouse_face_deferred_gc = 0;
1190 hlinfo->mouse_face_mouse_frame = 0; 1189 hlinfo->mouse_face_mouse_frame = 0;
1191 } 1190 }
1192 1191
@@ -1887,8 +1886,7 @@ static void
1887ns_frame_up_to_date (struct frame *f) 1886ns_frame_up_to_date (struct frame *f)
1888/* -------------------------------------------------------------------------- 1887/* --------------------------------------------------------------------------
1889 External (hook): Fix up mouse highlighting right after a full update. 1888 External (hook): Fix up mouse highlighting right after a full update.
1890 Some highlighting was deferred if GC was happening during 1889 Can't use FRAME_MOUSE_UPDATE due to ns_frame_begin and ns_frame_end calls.
1891 note_mouse_highlight (), while other highlighting was deferred for update.
1892 -------------------------------------------------------------------------- */ 1890 -------------------------------------------------------------------------- */
1893{ 1891{
1894 NSTRACE (ns_frame_up_to_date); 1892 NSTRACE (ns_frame_up_to_date);
@@ -1896,19 +1894,17 @@ ns_frame_up_to_date (struct frame *f)
1896 if (FRAME_NS_P (f)) 1894 if (FRAME_NS_P (f))
1897 { 1895 {
1898 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); 1896 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
1899 if ((hlinfo->mouse_face_deferred_gc || f ==hlinfo->mouse_face_mouse_frame) 1897 if (f == hlinfo->mouse_face_mouse_frame)
1900 /*&& hlinfo->mouse_face_mouse_frame*/) 1898 {
1901 { 1899 block_input ();
1902 block_input ();
1903 ns_update_begin(f); 1900 ns_update_begin(f);
1904 if (hlinfo->mouse_face_mouse_frame) 1901 if (hlinfo->mouse_face_mouse_frame)
1905 note_mouse_highlight (hlinfo->mouse_face_mouse_frame, 1902 note_mouse_highlight (hlinfo->mouse_face_mouse_frame,
1906 hlinfo->mouse_face_mouse_x, 1903 hlinfo->mouse_face_mouse_x,
1907 hlinfo->mouse_face_mouse_y); 1904 hlinfo->mouse_face_mouse_y);
1908 hlinfo->mouse_face_deferred_gc = 0;
1909 ns_update_end(f); 1905 ns_update_end(f);
1910 unblock_input (); 1906 unblock_input ();
1911 } 1907 }
1912 } 1908 }
1913} 1909}
1914 1910
@@ -3869,7 +3865,6 @@ ns_initialize_display_info (struct ns_display_info *dpyinfo)
3869 dpyinfo->root_window = 42; /* a placeholder.. */ 3865 dpyinfo->root_window = 42; /* a placeholder.. */
3870 3866
3871 hlinfo->mouse_face_mouse_frame = NULL; 3867 hlinfo->mouse_face_mouse_frame = NULL;
3872 hlinfo->mouse_face_deferred_gc = 0;
3873 hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; 3868 hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
3874 hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; 3869 hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
3875 hlinfo->mouse_face_face_id = DEFAULT_FACE_ID; 3870 hlinfo->mouse_face_face_id = DEFAULT_FACE_ID;
diff --git a/src/w32term.c b/src/w32term.c
index 032912c27f4..ab6afd32c75 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -723,21 +723,7 @@ static void
723w32_frame_up_to_date (struct frame *f) 723w32_frame_up_to_date (struct frame *f)
724{ 724{
725 if (FRAME_W32_P (f)) 725 if (FRAME_W32_P (f))
726 { 726 FRAME_MOUSE_UPDATE (f);
727 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
728
729 if (hlinfo->mouse_face_deferred_gc
730 || f == hlinfo->mouse_face_mouse_frame)
731 {
732 block_input ();
733 if (hlinfo->mouse_face_mouse_frame)
734 note_mouse_highlight (hlinfo->mouse_face_mouse_frame,
735 hlinfo->mouse_face_mouse_x,
736 hlinfo->mouse_face_mouse_y);
737 hlinfo->mouse_face_deferred_gc = 0;
738 unblock_input ();
739 }
740 }
741} 727}
742 728
743 729
@@ -5979,7 +5965,6 @@ x_free_frame_resources (struct frame *f)
5979 hlinfo->mouse_face_end_row 5965 hlinfo->mouse_face_end_row
5980 = hlinfo->mouse_face_end_col = -1; 5966 = hlinfo->mouse_face_end_col = -1;
5981 hlinfo->mouse_face_window = Qnil; 5967 hlinfo->mouse_face_window = Qnil;
5982 hlinfo->mouse_face_deferred_gc = 0;
5983 hlinfo->mouse_face_mouse_frame = 0; 5968 hlinfo->mouse_face_mouse_frame = 0;
5984 } 5969 }
5985 5970
diff --git a/src/xdisp.c b/src/xdisp.c
index e9b20d148c7..5d260d851ef 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -9642,7 +9642,7 @@ message2_nolog (const char *m, ptrdiff_t nbytes, int multibyte)
9642 do_pending_window_change (0); 9642 do_pending_window_change (0);
9643 echo_area_display (1); 9643 echo_area_display (1);
9644 do_pending_window_change (0); 9644 do_pending_window_change (0);
9645 if (FRAME_TERMINAL (f)->frame_up_to_date_hook != 0 && ! gc_in_progress) 9645 if (FRAME_TERMINAL (f)->frame_up_to_date_hook)
9646 (*FRAME_TERMINAL (f)->frame_up_to_date_hook) (f); 9646 (*FRAME_TERMINAL (f)->frame_up_to_date_hook) (f);
9647 } 9647 }
9648} 9648}
@@ -9739,7 +9739,7 @@ message3_nolog (Lisp_Object m, ptrdiff_t nbytes, int multibyte)
9739 do_pending_window_change (0); 9739 do_pending_window_change (0);
9740 echo_area_display (1); 9740 echo_area_display (1);
9741 do_pending_window_change (0); 9741 do_pending_window_change (0);
9742 if (FRAME_TERMINAL (f)->frame_up_to_date_hook != 0 && ! gc_in_progress) 9742 if (FRAME_TERMINAL (f)->frame_up_to_date_hook)
9743 (*FRAME_TERMINAL (f)->frame_up_to_date_hook) (f); 9743 (*FRAME_TERMINAL (f)->frame_up_to_date_hook) (f);
9744 } 9744 }
9745} 9745}
@@ -27685,12 +27685,6 @@ note_mouse_highlight (struct frame *f, int x, int y)
27685 if (hlinfo->mouse_face_defer) 27685 if (hlinfo->mouse_face_defer)
27686 return; 27686 return;
27687 27687
27688 if (gc_in_progress)
27689 {
27690 hlinfo->mouse_face_deferred_gc = 1;
27691 return;
27692 }
27693
27694 /* Which window is that in? */ 27688 /* Which window is that in? */
27695 window = window_from_coordinates (f, x, y, &part, 1); 27689 window = window_from_coordinates (f, x, y, &part, 1);
27696 27690
diff --git a/src/xterm.c b/src/xterm.c
index 463d82b4ee2..61e942e10d2 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -669,21 +669,7 @@ static void
669XTframe_up_to_date (struct frame *f) 669XTframe_up_to_date (struct frame *f)
670{ 670{
671 if (FRAME_X_P (f)) 671 if (FRAME_X_P (f))
672 { 672 FRAME_MOUSE_UPDATE (f);
673 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
674
675 if (hlinfo->mouse_face_deferred_gc
676 || f == hlinfo->mouse_face_mouse_frame)
677 {
678 block_input ();
679 if (hlinfo->mouse_face_mouse_frame)
680 note_mouse_highlight (hlinfo->mouse_face_mouse_frame,
681 hlinfo->mouse_face_mouse_x,
682 hlinfo->mouse_face_mouse_y);
683 hlinfo->mouse_face_deferred_gc = 0;
684 unblock_input ();
685 }
686 }
687} 673}
688 674
689 675
@@ -9502,7 +9488,6 @@ x_free_frame_resources (struct frame *f)
9502 hlinfo->mouse_face_end_row 9488 hlinfo->mouse_face_end_row
9503 = hlinfo->mouse_face_end_col = -1; 9489 = hlinfo->mouse_face_end_col = -1;
9504 hlinfo->mouse_face_window = Qnil; 9490 hlinfo->mouse_face_window = Qnil;
9505 hlinfo->mouse_face_deferred_gc = 0;
9506 hlinfo->mouse_face_mouse_frame = 0; 9491 hlinfo->mouse_face_mouse_frame = 0;
9507 } 9492 }
9508 9493
@@ -10153,7 +10138,6 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
10153 dpyinfo->bitmaps_last = 0; 10138 dpyinfo->bitmaps_last = 0;
10154 dpyinfo->scratch_cursor_gc = 0; 10139 dpyinfo->scratch_cursor_gc = 0;
10155 hlinfo->mouse_face_mouse_frame = 0; 10140 hlinfo->mouse_face_mouse_frame = 0;
10156 hlinfo->mouse_face_deferred_gc = 0;
10157 hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; 10141 hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
10158 hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; 10142 hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
10159 hlinfo->mouse_face_face_id = DEFAULT_FACE_ID; 10143 hlinfo->mouse_face_face_id = DEFAULT_FACE_ID;