diff options
| author | Eli Zaretskii | 2012-06-16 10:18:44 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2012-06-16 10:18:44 +0300 |
| commit | 4c5501e98fe2336ef7b16bd276dfbbe3917376e9 (patch) | |
| tree | abe5515a45671664dc134e935a67f1093bd1fccd /src | |
| parent | b6974efa3bd268e2ac72c3dc0e52585dc31d60f8 (diff) | |
| download | emacs-4c5501e98fe2336ef7b16bd276dfbbe3917376e9.tar.gz emacs-4c5501e98fe2336ef7b16bd276dfbbe3917376e9.zip | |
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')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/window.c | 40 |
2 files changed, 29 insertions, 17 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 416b74c9f68..6b2984c8825 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2012-06-16 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * window.c (Fdelete_other_windows_internal) | ||
| 4 | (Fdelete_window_internal): Don't access frame's mouse highlight | ||
| 5 | info of the initial frame. (Bug#11677) | ||
| 6 | |||
| 1 | 2012-06-14 Paul Eggert <eggert@cs.ucla.edu> | 7 | 2012-06-14 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 8 | ||
| 3 | * .gdbinit (xgetint): Fix recently-introduced paren typo. | 9 | * .gdbinit (xgetint): Fix recently-introduced paren typo. |
diff --git a/src/window.c b/src/window.c index 54ad0af4c3f..a3461cef90f 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -2566,7 +2566,6 @@ window-start value is reasonable when this function is called. */) | |||
| 2566 | Lisp_Object sibling, pwindow, swindow IF_LINT (= Qnil), delta; | 2566 | Lisp_Object sibling, pwindow, swindow IF_LINT (= Qnil), delta; |
| 2567 | ptrdiff_t startpos IF_LINT (= 0); | 2567 | ptrdiff_t startpos IF_LINT (= 0); |
| 2568 | int top IF_LINT (= 0), new_top, resize_failed; | 2568 | int top IF_LINT (= 0), new_top, resize_failed; |
| 2569 | Mouse_HLInfo *hlinfo; | ||
| 2570 | 2569 | ||
| 2571 | w = decode_any_window (window); | 2570 | w = decode_any_window (window); |
| 2572 | XSETWINDOW (window, w); | 2571 | XSETWINDOW (window, w); |
| @@ -2647,19 +2646,23 @@ window-start value is reasonable when this function is called. */) | |||
| 2647 | } | 2646 | } |
| 2648 | 2647 | ||
| 2649 | BLOCK_INPUT; | 2648 | BLOCK_INPUT; |
| 2650 | hlinfo = MOUSE_HL_INFO (f); | 2649 | if (!FRAME_INITIAL_P (f)) |
| 2651 | /* We are going to free the glyph matrices of WINDOW, and with that | ||
| 2652 | we might lose any information about glyph rows that have some of | ||
| 2653 | their glyphs highlighted in mouse face. (These rows are marked | ||
| 2654 | with a non-zero mouse_face_p flag.) If WINDOW indeed has some | ||
| 2655 | glyphs highlighted in mouse face, signal to frame's up-to-date | ||
| 2656 | hook that mouse highlight was overwritten, so that it will | ||
| 2657 | arrange for redisplaying the highlight. */ | ||
| 2658 | if (EQ (hlinfo->mouse_face_window, window)) | ||
| 2659 | { | 2650 | { |
| 2660 | hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; | 2651 | Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); |
| 2661 | hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; | 2652 | |
| 2662 | hlinfo->mouse_face_window = Qnil; | 2653 | /* We are going to free the glyph matrices of WINDOW, and with |
| 2654 | that we might lose any information about glyph rows that have | ||
| 2655 | some of their glyphs highlighted in mouse face. (These rows | ||
| 2656 | are marked with a non-zero mouse_face_p flag.) If WINDOW | ||
| 2657 | indeed has some glyphs highlighted in mouse face, signal to | ||
| 2658 | frame's up-to-date hook that mouse highlight was overwritten, | ||
| 2659 | so that it will arrange for redisplaying the highlight. */ | ||
| 2660 | if (EQ (hlinfo->mouse_face_window, window)) | ||
| 2661 | { | ||
| 2662 | hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; | ||
| 2663 | hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; | ||
| 2664 | hlinfo->mouse_face_window = Qnil; | ||
| 2665 | } | ||
| 2663 | } | 2666 | } |
| 2664 | free_window_matrices (r); | 2667 | free_window_matrices (r); |
| 2665 | 2668 | ||
| @@ -3903,7 +3906,6 @@ Signal an error when WINDOW is the only window on its frame. */) | |||
| 3903 | && EQ (r->new_total, (horflag ? r->total_cols : r->total_lines))) | 3906 | && EQ (r->new_total, (horflag ? r->total_cols : r->total_lines))) |
| 3904 | /* We can delete WINDOW now. */ | 3907 | /* We can delete WINDOW now. */ |
| 3905 | { | 3908 | { |
| 3906 | Mouse_HLInfo *hlinfo; | ||
| 3907 | 3909 | ||
| 3908 | /* Block input. */ | 3910 | /* Block input. */ |
| 3909 | BLOCK_INPUT; | 3911 | BLOCK_INPUT; |
| @@ -3911,9 +3913,13 @@ Signal an error when WINDOW is the only window on its frame. */) | |||
| 3911 | 3913 | ||
| 3912 | /* If this window is referred to by the dpyinfo's mouse | 3914 | /* If this window is referred to by the dpyinfo's mouse |
| 3913 | highlight, invalidate that slot to be safe (Bug#9904). */ | 3915 | highlight, invalidate that slot to be safe (Bug#9904). */ |
| 3914 | hlinfo = MOUSE_HL_INFO (XFRAME (w->frame)); | 3916 | if (!FRAME_INITIAL_P (f)) |
| 3915 | if (EQ (hlinfo->mouse_face_window, window)) | 3917 | { |
| 3916 | hlinfo->mouse_face_window = Qnil; | 3918 | Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); |
| 3919 | |||
| 3920 | if (EQ (hlinfo->mouse_face_window, window)) | ||
| 3921 | hlinfo->mouse_face_window = Qnil; | ||
| 3922 | } | ||
| 3917 | 3923 | ||
| 3918 | windows_or_buffers_changed++; | 3924 | windows_or_buffers_changed++; |
| 3919 | Vwindow_list = Qnil; | 3925 | Vwindow_list = Qnil; |