aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1996-10-31 22:05:51 +0000
committerRichard M. Stallman1996-10-31 22:05:51 +0000
commite687d06efa700117689dca2e919ff175a5c7e28d (patch)
tree2d684fc31d12a50ff15136b133abc23661bc8eb5
parentc439687b4d3a617dbdb8e90e401a9db17d08426d (diff)
downloademacs-e687d06efa700117689dca2e919ff175a5c7e28d.tar.gz
emacs-e687d06efa700117689dca2e919ff175a5c7e28d.zip
(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.
-rw-r--r--src/xterm.c28
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)
2267 dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1; 2267 dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1;
2268 dpyinfo->mouse_face_window = Qnil; 2268 dpyinfo->mouse_face_window = Qnil;
2269} 2269}
2270
2271/* Just discard the mouse face information for frame F, if any.
2272 This is used when the size of F is changed. */
2273
2274cancel_mouse_face (f)
2275 FRAME_PTR f;
2276{
2277 Lisp_Object window;
2278 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
2279
2280 window = dpyinfo->mouse_face_window;
2281 if (! NILP (window) && XFRAME (XWINDOW (window)->frame) == f)
2282 {
2283 dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1;
2284 dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1;
2285 dpyinfo->mouse_face_window = Qnil;
2286 }
2287}
2270 2288
2271static struct scroll_bar *x_window_to_scroll_bar (); 2289static struct scroll_bar *x_window_to_scroll_bar ();
2272static void x_scroll_bar_report_motion (); 2290static void x_scroll_bar_report_motion ();
@@ -3998,6 +4016,7 @@ XTread_socket (sd, bufp, numchars, expected)
3998 { 4016 {
3999 change_frame_size (f, rows, columns, 0, 1); 4017 change_frame_size (f, rows, columns, 0, 1);
4000 SET_FRAME_GARBAGED (f); 4018 SET_FRAME_GARBAGED (f);
4019 cancel_mouse_face (f);
4001 } 4020 }
4002#endif 4021#endif
4003 4022
@@ -5099,7 +5118,6 @@ x_set_window_size (f, change_gravity, cols, rows)
5099{ 5118{
5100 int pixelwidth, pixelheight; 5119 int pixelwidth, pixelheight;
5101 int mask; 5120 int mask;
5102 Lisp_Object window;
5103 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 5121 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
5104 5122
5105 BLOCK_INPUT; 5123 BLOCK_INPUT;
@@ -5173,13 +5191,7 @@ x_set_window_size (f, change_gravity, cols, rows)
5173 since it might be in a place that's outside the new frame size. 5191 since it might be in a place that's outside the new frame size.
5174 Actually checking whether it is outside is a pain in the neck, 5192 Actually checking whether it is outside is a pain in the neck,
5175 so don't try--just let the highlighting be done afresh with new size. */ 5193 so don't try--just let the highlighting be done afresh with new size. */
5176 window = dpyinfo->mouse_face_window; 5194 cancel_mouse_face (f);
5177 if (! NILP (window) && XFRAME (window) == f)
5178 {
5179 dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1;
5180 dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1;
5181 dpyinfo->mouse_face_window = Qnil;
5182 }
5183 5195
5184 UNBLOCK_INPUT; 5196 UNBLOCK_INPUT;
5185} 5197}