diff options
author | Eli Zaretskii <eliz@gnu.org> | 1999-12-30 14:14:38 +0000 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 1999-12-30 14:14:38 +0000 |
commit | 8ccb9a546b981224e8e354ea2a818541e6e9b610 (patch) | |
tree | 16b8f0af229b6425c4a9a514908b88050457ce1c /src/msdos.c | |
parent | ef961722ad3e23cc1dbe1bd8cbb6efe3e3e63eda (diff) | |
download | emacs-8ccb9a546b981224e8e354ea2a818541e6e9b610.tar.gz |
(IT_update_begin): Don't dereference members of struct
window for deleted windows.
Diffstat (limited to 'src/msdos.c')
-rw-r--r-- | src/msdos.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/msdos.c b/src/msdos.c index cd969127fe1..3cd0d7e5a4e 100644 --- a/src/msdos.c +++ b/src/msdos.c @@ -1711,16 +1711,25 @@ IT_update_begin (struct frame *f) Likewise, don't do anything if the frame is garbaged; in that case, the frame's current matrix that we would use is all wrong, and we will redisplay that line anyway. */ - if (!NILP (display_info->mouse_face_window)) + if (!NILP (display_info->mouse_face_window) + && WINDOWP (display_info->mouse_face_window)) { struct window *w = XWINDOW (display_info->mouse_face_window); int i; - for (i = 0; i < w->desired_matrix->nrows; ++i) - if (MATRIX_ROW_ENABLED_P (w->desired_matrix, i)) - break; + /* If the mouse highlight is in the window that was deleted + (e.g., if it was popped by completion), clear highlight + unconditionally. */ + if (NILP (w->buffer)) + display_info->mouse_face_window = Qnil; + else + { + for (i = 0; i < w->desired_matrix->nrows; ++i) + if (MATRIX_ROW_ENABLED_P (w->desired_matrix, i)) + break; + } - if (i < w->desired_matrix->nrows) + if (NILP (w->buffer) || i < w->desired_matrix->nrows) clear_mouse_face (display_info); } } |