Commit 5d46f928 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(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.
parent f29f9e4a
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment