* 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.
This commit is contained in:
Dmitry Antipov 2012-11-22 13:32:32 +04:00
parent 0e70ce9335
commit 5c74767510
9 changed files with 46 additions and 76 deletions

View file

@ -1,3 +1,17 @@
2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
* 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 <dmantipov@yandex.ru>
* xdisp.c (window_buffer_changed): New function.

View file

@ -5331,12 +5331,12 @@ See Info node `(elisp)Garbage Collection'. */)
dump_zombies ();
#endif
unblock_input ();
check_cons_list ();
gc_in_progress = 0;
unblock_input ();
consing_since_gc = 0;
if (gc_cons_threshold < GC_DEFAULT_THRESHOLD / 10)
gc_cons_threshold = GC_DEFAULT_THRESHOLD / 10;

View file

@ -933,6 +933,21 @@ typedef struct frame *FRAME_PTR;
&& (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;

View file

@ -1649,10 +1649,6 @@ typedef struct {
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;

View file

@ -1275,7 +1275,6 @@ IT_update_begin (struct frame *f)
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 @@ IT_update_end (struct frame *f)
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 @@ internal_terminal_init (void)
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 =

View file

@ -1186,7 +1186,6 @@ Free a pool and temporary objects it refers to (callable from C)
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 @@ Free a pool and temporary objects it refers to (callable from C)
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 @@ Free a pool and temporary objects it refers to (callable from C)
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 @@ static Lisp_Object ns_string_to_lispmod (const char *s)
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;

View file

@ -723,21 +723,7 @@ static void
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 @@ x_free_frame_resources (struct frame *f)
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;
}

View file

@ -9642,7 +9642,7 @@ message2_nolog (const char *m, ptrdiff_t nbytes, int multibyte)
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 @@ message3_nolog (Lisp_Object m, ptrdiff_t nbytes, int multibyte)
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 @@ note_mouse_highlight (struct frame *f, int x, int y)
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);

View file

@ -669,21 +669,7 @@ static void
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 @@ x_free_frame_resources (struct frame *f)
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 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
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;