From aee9a898c4d9b7237b78e5be5e45562416957815 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Tue, 27 Feb 1996 01:16:35 +0000 Subject: [PATCH] (x_set_window_size): Clear out the mouse-highlighting data if it applies to this frame. Clear out the frame cursor position in Xt version as in Xlib version. (x_update_cursor): If no previous cursor position is known, leave the cursor off. --- src/xterm.c | 41 ++++++++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/src/xterm.c b/src/xterm.c index cb4704db937..70c83c65342 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -4394,6 +4394,11 @@ x_update_cursor (f, on) struct frame *f; int on; { + /* If we don't have any previous cursor position to use, + leave the cursor off. */ + if (f->phys_cursor_x < 0) + return; + BLOCK_INPUT; if (FRAME_DESIRED_CURSOR (f) == filled_box_cursor) @@ -5076,9 +5081,12 @@ 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); -#ifdef USE_X_TOOLKIT BLOCK_INPUT; + +#ifdef USE_X_TOOLKIT { /* The x and y position of the widget is clobbered by the call to XtSetValues within EmacsFrameSetCharSize. @@ -5090,12 +5098,9 @@ x_set_window_size (f, change_gravity, cols, rows) f->output_data.x->widget->core.x = xpos; f->output_data.x->widget->core.y = ypos; } - UNBLOCK_INPUT; #else /* not USE_X_TOOLKIT */ - BLOCK_INPUT; - check_frame_size (f, &rows, &cols); f->output_data.x->vertical_scroll_bar_extra = (!FRAME_HAS_VERTICAL_SCROLL_BARS (f) @@ -5127,6 +5132,16 @@ x_set_window_size (f, change_gravity, cols, rows) PIXEL_WIDTH (f) = pixelwidth; PIXEL_HEIGHT (f) = pixelheight; + /* We've set {FRAME,PIXEL}_{WIDTH,HEIGHT} to the values we hope to + receive in the ConfigureNotify event; if we get what we asked + for, then the event won't cause the screen to become garbaged, so + we have to make sure to do it here. */ + SET_FRAME_GARBAGED (f); + + XFlush (FRAME_X_DISPLAY (f)); + +#endif /* not USE_X_TOOLKIT */ + /* If cursor was outside the new size, mark it as off. */ if (f->phys_cursor_y >= rows || f->phys_cursor_x >= cols) @@ -5135,15 +5150,19 @@ x_set_window_size (f, change_gravity, cols, rows) f->phys_cursor_y = -1; } - /* We've set {FRAME,PIXEL}_{WIDTH,HEIGHT} to the values we hope to - receive in the ConfigureNotify event; if we get what we asked - for, then the event won't cause the screen to become garbaged, so - we have to make sure to do it here. */ - SET_FRAME_GARBAGED (f); + /* Clear out any recollection of where the mouse highlighting was, + 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; + } - XFlush (FRAME_X_DISPLAY (f)); UNBLOCK_INPUT; -#endif /* not USE_X_TOOLKIT */ } /* Mouse warping. */ -- 2.39.2