diff options
| author | Richard M. Stallman | 1995-06-29 17:32:59 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-06-29 17:32:59 +0000 |
| commit | 5d46f92806a6b2282b591a68f69906a387c8410a (patch) | |
| tree | 0385433adef09bde81bb0c826053caa21b447dca /src | |
| parent | f29f9e4afc2a54e937e0403555a41734599725be (diff) | |
| download | emacs-5d46f92806a6b2282b591a68f69906a387c8410a.tar.gz emacs-5d46f92806a6b2282b591a68f69906a387c8410a.zip | |
(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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 62 |
1 files 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) | |||
| 1413 | XSetWindowBorder (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 1413 | XSetWindowBorder (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
| 1414 | f->display.x->border_pixel); | 1414 | f->display.x->border_pixel); |
| 1415 | UNBLOCK_INPUT; | 1415 | UNBLOCK_INPUT; |
| 1416 | x_display_cursor (f, 1); | 1416 | x_update_cursor (f, 1); |
| 1417 | } | 1417 | } |
| 1418 | 1418 | ||
| 1419 | static void | 1419 | static void |
| @@ -1428,7 +1428,7 @@ frame_unhighlight (f) | |||
| 1428 | XSetWindowBorderPixmap (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 1428 | XSetWindowBorderPixmap (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
| 1429 | f->display.x->border_tile); | 1429 | f->display.x->border_tile); |
| 1430 | UNBLOCK_INPUT; | 1430 | UNBLOCK_INPUT; |
| 1431 | x_display_cursor (f, 1); | 1431 | x_update_cursor (f, 1); |
| 1432 | } | 1432 | } |
| 1433 | 1433 | ||
| 1434 | static void XTframe_rehighlight (); | 1434 | static void XTframe_rehighlight (); |
| @@ -3612,6 +3612,11 @@ XTread_socket (sd, bufp, numchars, waitp, expected) | |||
| 3612 | /* make_lispy_event turns chars into control chars. | 3612 | /* make_lispy_event turns chars into control chars. |
| 3613 | Don't do it here because XLookupString is too eager. */ | 3613 | Don't do it here because XLookupString is too eager. */ |
| 3614 | event.xkey.state &= ~ControlMask; | 3614 | event.xkey.state &= ~ControlMask; |
| 3615 | event.xkey.state &= ~(dpyinfo->meta_mod_mask | ||
| 3616 | | dpyinfo->super_mod_mask | ||
| 3617 | | dpyinfo->hyper_mod_mask | ||
| 3618 | | dpyinfo->alt_mod_mask); | ||
| 3619 | |||
| 3615 | nbytes = XLookupString (&event.xkey, copy_buffer, | 3620 | nbytes = XLookupString (&event.xkey, copy_buffer, |
| 3616 | 80, &keysym, &compose_status); | 3621 | 80, &keysym, &compose_status); |
| 3617 | 3622 | ||
| @@ -4127,14 +4132,6 @@ x_display_bar_cursor (f, on) | |||
| 4127 | if (! on && f->phys_cursor_x < 0) | 4132 | if (! on && f->phys_cursor_x < 0) |
| 4128 | return; | 4133 | return; |
| 4129 | 4134 | ||
| 4130 | /* If we're not updating, then we want to use the current frame's | ||
| 4131 | cursor position, not our local idea of where the cursor ought to be. */ | ||
| 4132 | if (f != updating_frame) | ||
| 4133 | { | ||
| 4134 | curs_x = FRAME_CURSOR_X (f); | ||
| 4135 | curs_y = FRAME_CURSOR_Y (f); | ||
| 4136 | } | ||
| 4137 | |||
| 4138 | /* If there is anything wrong with the current cursor state, remove it. */ | 4135 | /* If there is anything wrong with the current cursor state, remove it. */ |
| 4139 | if (f->phys_cursor_x >= 0 | 4136 | if (f->phys_cursor_x >= 0 |
| 4140 | && (!on | 4137 | && (!on |
| @@ -4198,14 +4195,6 @@ x_display_box_cursor (f, on) | |||
| 4198 | if (!on && f->phys_cursor_x < 0) | 4195 | if (!on && f->phys_cursor_x < 0) |
| 4199 | return; | 4196 | return; |
| 4200 | 4197 | ||
| 4201 | /* If we're not updating, then we want to use the current frame's | ||
| 4202 | cursor position, not our local idea of where the cursor ought to be. */ | ||
| 4203 | if (f != updating_frame) | ||
| 4204 | { | ||
| 4205 | curs_x = FRAME_CURSOR_X (f); | ||
| 4206 | curs_y = FRAME_CURSOR_Y (f); | ||
| 4207 | } | ||
| 4208 | |||
| 4209 | /* If cursor is currently being shown and we don't want it to be | 4198 | /* If cursor is currently being shown and we don't want it to be |
| 4210 | or it is in the wrong place, | 4199 | or it is in the wrong place, |
| 4211 | or we want a hollow box and it's not so, (pout!) | 4200 | or we want a hollow box and it's not so, (pout!) |
| @@ -4287,12 +4276,49 @@ x_display_box_cursor (f, on) | |||
| 4287 | XFlush (FRAME_X_DISPLAY (f)); | 4276 | XFlush (FRAME_X_DISPLAY (f)); |
| 4288 | } | 4277 | } |
| 4289 | 4278 | ||
| 4279 | /* Display the cursor on frame F, or clear it, according to ON. | ||
| 4280 | Use the position specified by curs_x and curs_y | ||
| 4281 | if we are doing an update of frame F now. | ||
| 4282 | Otherwise use the position in the FRAME_CURSOR_X and FRAME_CURSOR_Y fields | ||
| 4283 | of F. */ | ||
| 4284 | |||
| 4290 | x_display_cursor (f, on) | 4285 | x_display_cursor (f, on) |
| 4291 | struct frame *f; | 4286 | struct frame *f; |
| 4292 | int on; | 4287 | int on; |
| 4293 | { | 4288 | { |
| 4294 | BLOCK_INPUT; | 4289 | BLOCK_INPUT; |
| 4295 | 4290 | ||
| 4291 | /* If we're not updating, then don't change the physical cursor | ||
| 4292 | position. Just change (if appropriate) the style of display. */ | ||
| 4293 | if (f != updating_frame) | ||
| 4294 | { | ||
| 4295 | curs_x = FRAME_CURSOR_X (f); | ||
| 4296 | curs_y = FRAME_CURSOR_Y (f); | ||
| 4297 | } | ||
| 4298 | |||
| 4299 | if (FRAME_DESIRED_CURSOR (f) == filled_box_cursor) | ||
| 4300 | x_display_box_cursor (f, on); | ||
| 4301 | else if (FRAME_DESIRED_CURSOR (f) == bar_cursor) | ||
| 4302 | x_display_bar_cursor (f, on); | ||
| 4303 | else | ||
| 4304 | /* Those are the only two we have implemented! */ | ||
| 4305 | abort (); | ||
| 4306 | |||
| 4307 | UNBLOCK_INPUT; | ||
| 4308 | } | ||
| 4309 | |||
| 4310 | /* Display the cursor on frame F, or clear it, according to ON. | ||
| 4311 | Don't change the cursor's position. */ | ||
| 4312 | |||
| 4313 | x_update_cursor (f, on) | ||
| 4314 | struct frame *f; | ||
| 4315 | int on; | ||
| 4316 | { | ||
| 4317 | BLOCK_INPUT; | ||
| 4318 | |||
| 4319 | curs_x = f->phys_cursor_x; | ||
| 4320 | curs_y = f->phys_cursor_y; | ||
| 4321 | |||
| 4296 | if (FRAME_DESIRED_CURSOR (f) == filled_box_cursor) | 4322 | if (FRAME_DESIRED_CURSOR (f) == filled_box_cursor) |
| 4297 | x_display_box_cursor (f, on); | 4323 | x_display_box_cursor (f, on); |
| 4298 | else if (FRAME_DESIRED_CURSOR (f) == bar_cursor) | 4324 | else if (FRAME_DESIRED_CURSOR (f) == bar_cursor) |