From 5d46f92806a6b2282b591a68f69906a387c8410a Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Thu, 29 Jun 1995 17:32:59 +0000 Subject: [PATCH] (XTread_socket): Turn off meta, super, hyper and alt bits in the arg for XLookupKey. (x_display_bar_cursor, x_display_box_cursor): Don't alter curs_x or curs_y here. (x_display_cursor): Copy them from the frame cursor here. (x_update_cursor): New function. (frame_highlight, frame_unhighlight): Use x_update_cursor. --- src/xterm.c | 62 +++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 44 insertions(+), 18 deletions(-) diff --git a/src/xterm.c b/src/xterm.c index 072974a0ec2..534a27b7237 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -1413,7 +1413,7 @@ frame_highlight (f) XSetWindowBorder (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), f->display.x->border_pixel); UNBLOCK_INPUT; - x_display_cursor (f, 1); + x_update_cursor (f, 1); } static void @@ -1428,7 +1428,7 @@ frame_unhighlight (f) XSetWindowBorderPixmap (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), f->display.x->border_tile); UNBLOCK_INPUT; - x_display_cursor (f, 1); + x_update_cursor (f, 1); } static void XTframe_rehighlight (); @@ -3612,6 +3612,11 @@ XTread_socket (sd, bufp, numchars, waitp, expected) /* make_lispy_event turns chars into control chars. Don't do it here because XLookupString is too eager. */ event.xkey.state &= ~ControlMask; + event.xkey.state &= ~(dpyinfo->meta_mod_mask + | dpyinfo->super_mod_mask + | dpyinfo->hyper_mod_mask + | dpyinfo->alt_mod_mask); + nbytes = XLookupString (&event.xkey, copy_buffer, 80, &keysym, &compose_status); @@ -4127,14 +4132,6 @@ x_display_bar_cursor (f, on) if (! on && f->phys_cursor_x < 0) return; - /* If we're not updating, then we want to use the current frame's - cursor position, not our local idea of where the cursor ought to be. */ - if (f != updating_frame) - { - curs_x = FRAME_CURSOR_X (f); - curs_y = FRAME_CURSOR_Y (f); - } - /* If there is anything wrong with the current cursor state, remove it. */ if (f->phys_cursor_x >= 0 && (!on @@ -4198,14 +4195,6 @@ x_display_box_cursor (f, on) if (!on && f->phys_cursor_x < 0) return; - /* If we're not updating, then we want to use the current frame's - cursor position, not our local idea of where the cursor ought to be. */ - if (f != updating_frame) - { - curs_x = FRAME_CURSOR_X (f); - curs_y = FRAME_CURSOR_Y (f); - } - /* If cursor is currently being shown and we don't want it to be or it is in the wrong place, or we want a hollow box and it's not so, (pout!) @@ -4287,12 +4276,49 @@ x_display_box_cursor (f, on) XFlush (FRAME_X_DISPLAY (f)); } +/* Display the cursor on frame F, or clear it, according to ON. + Use the position specified by curs_x and curs_y + if we are doing an update of frame F now. + Otherwise use the position in the FRAME_CURSOR_X and FRAME_CURSOR_Y fields + of F. */ + x_display_cursor (f, on) struct frame *f; int on; { BLOCK_INPUT; + /* If we're not updating, then don't change the physical cursor + position. Just change (if appropriate) the style of display. */ + if (f != updating_frame) + { + curs_x = FRAME_CURSOR_X (f); + curs_y = FRAME_CURSOR_Y (f); + } + + if (FRAME_DESIRED_CURSOR (f) == filled_box_cursor) + x_display_box_cursor (f, on); + else if (FRAME_DESIRED_CURSOR (f) == bar_cursor) + x_display_bar_cursor (f, on); + else + /* Those are the only two we have implemented! */ + abort (); + + UNBLOCK_INPUT; +} + +/* Display the cursor on frame F, or clear it, according to ON. + Don't change the cursor's position. */ + +x_update_cursor (f, on) + struct frame *f; + int on; +{ + BLOCK_INPUT; + + curs_x = f->phys_cursor_x; + curs_y = f->phys_cursor_y; + if (FRAME_DESIRED_CURSOR (f) == filled_box_cursor) x_display_box_cursor (f, on); else if (FRAME_DESIRED_CURSOR (f) == bar_cursor) -- 2.39.2