diff options
| author | Richard M. Stallman <rms@gnu.org> | 1996-10-31 22:05:51 +0000 |
|---|---|---|
| committer | Richard M. Stallman <rms@gnu.org> | 1996-10-31 22:05:51 +0000 |
| commit | e687d06efa700117689dca2e919ff175a5c7e28d (patch) | |
| tree | 2d684fc31d12a50ff15136b133abc23661bc8eb5 /src | |
| parent | c439687b4d3a617dbdb8e90e401a9db17d08426d (diff) | |
| download | emacs-e687d06efa700117689dca2e919ff175a5c7e28d.tar.gz | |
(cancel_mouse_face): New function. Code copied from
x_set_window_size, fixing a bug.
(x_set_window_size): Use cancel_mouse_face.
(XTread_socket): When frame size has changed, call cancel_mouse_face.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/src/xterm.c b/src/xterm.c index c85f79216c1..434de4d5ff7 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -2267,6 +2267,24 @@ clear_mouse_face (dpyinfo) dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1; dpyinfo->mouse_face_window = Qnil; } + +/* Just discard the mouse face information for frame F, if any. + This is used when the size of F is changed. */ + +cancel_mouse_face (f) + FRAME_PTR f; +{ + Lisp_Object window; + struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); + + window = dpyinfo->mouse_face_window; + if (! NILP (window) && XFRAME (XWINDOW (window)->frame) == f) + { + dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1; + dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1; + dpyinfo->mouse_face_window = Qnil; + } +} static struct scroll_bar *x_window_to_scroll_bar (); static void x_scroll_bar_report_motion (); @@ -3998,6 +4016,7 @@ XTread_socket (sd, bufp, numchars, expected) { change_frame_size (f, rows, columns, 0, 1); SET_FRAME_GARBAGED (f); + cancel_mouse_face (f); } #endif @@ -5099,7 +5118,6 @@ x_set_window_size (f, change_gravity, cols, rows) { int pixelwidth, pixelheight; int mask; - Lisp_Object window; struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); BLOCK_INPUT; @@ -5173,13 +5191,7 @@ x_set_window_size (f, change_gravity, cols, rows) since it might be in a place that's outside the new frame size. Actually checking whether it is outside is a pain in the neck, so don't try--just let the highlighting be done afresh with new size. */ - window = dpyinfo->mouse_face_window; - if (! NILP (window) && XFRAME (window) == f) - { - dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1; - dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1; - dpyinfo->mouse_face_window = Qnil; - } + cancel_mouse_face (f); UNBLOCK_INPUT; } |
