aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
authorEli Zaretskii <[email protected]>2012-06-16 10:18:44 +0300
committerEli Zaretskii <[email protected]>2012-06-16 10:18:44 +0300
commit4c5501e98fe2336ef7b16bd276dfbbe3917376e9 (patch)
treeabe5515a45671664dc134e935a67f1093bd1fccd /src/window.c
parentb6974efa3bd268e2ac72c3dc0e52585dc31d60f8 (diff)
Fix bug #11677 with segfault when deleting windows under -batch.
src/window.c (Fdelete_other_windows_internal) (Fdelete_window_internal): Don't access frame's mouse highlight info of the initial frame.
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c40
1 files changed, 23 insertions, 17 deletions
diff --git a/src/window.c b/src/window.c
index 54ad0af4c3..a3461cef90 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2566,7 +2566,6 @@ window-start value is reasonable when this function is called. */)
Lisp_Object sibling, pwindow, swindow IF_LINT (= Qnil), delta;
ptrdiff_t startpos IF_LINT (= 0);
int top IF_LINT (= 0), new_top, resize_failed;
- Mouse_HLInfo *hlinfo;
w = decode_any_window (window);
XSETWINDOW (window, w);
@@ -2647,19 +2646,23 @@ window-start value is reasonable when this function is called. */)
}
BLOCK_INPUT;
- hlinfo = MOUSE_HL_INFO (f);
- /* We are going to free the glyph matrices of WINDOW, and with that
- we might lose any information about glyph rows that have some of
- their glyphs highlighted in mouse face. (These rows are marked
- with a non-zero mouse_face_p flag.) If WINDOW indeed has some
- glyphs highlighted in mouse face, signal to frame's up-to-date
- hook that mouse highlight was overwritten, so that it will
- arrange for redisplaying the highlight. */
- if (EQ (hlinfo->mouse_face_window, window))
+ if (!FRAME_INITIAL_P (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;
+ Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
+
+ /* We are going to free the glyph matrices of WINDOW, and with
+ that we might lose any information about glyph rows that have
+ some of their glyphs highlighted in mouse face. (These rows
+ are marked with a non-zero mouse_face_p flag.) If WINDOW
+ indeed has some glyphs highlighted in mouse face, signal to
+ frame's up-to-date hook that mouse highlight was overwritten,
+ so that it will arrange for redisplaying the highlight. */
+ if (EQ (hlinfo->mouse_face_window, window))
+ {
+ 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;
+ }
}
free_window_matrices (r);
@@ -3903,7 +3906,6 @@ 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;
@@ -3911,9 +3913,13 @@ Signal an error when WINDOW is the only window on its frame. */)
/* 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;
+ if (!FRAME_INITIAL_P (f))
+ {
+ Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
+
+ if (EQ (hlinfo->mouse_face_window, window))
+ hlinfo->mouse_face_window = Qnil;
+ }
windows_or_buffers_changed++;
Vwindow_list = Qnil;