Mercurial > emacs
comparison src/xterm.c @ 12431:80a5aedfb4c7
(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.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 29 Jun 1995 17:32:59 +0000 |
parents | 1b571a7992b0 |
children | bfbe2490dbf0 |
comparison
equal
deleted
inserted
replaced
12430:14792ea851f9 | 12431:80a5aedfb4c7 |
---|---|
1411 client", so we can always change it to whatever we want. */ | 1411 client", so we can always change it to whatever we want. */ |
1412 BLOCK_INPUT; | 1412 BLOCK_INPUT; |
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 |
1420 frame_unhighlight (f) | 1420 frame_unhighlight (f) |
1421 struct frame *f; | 1421 struct frame *f; |
1426 client", so we can always change it to whatever we want. */ | 1426 client", so we can always change it to whatever we want. */ |
1427 BLOCK_INPUT; | 1427 BLOCK_INPUT; |
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 (); |
1435 static void x_frame_rehighlight (); | 1435 static void x_frame_rehighlight (); |
1436 | 1436 |
3610 /* This will have to go some day... */ | 3610 /* This will have to go some day... */ |
3611 | 3611 |
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 |
3618 orig_keysym = keysym; | 3623 orig_keysym = keysym; |
3619 | 3624 |
4125 return; | 4130 return; |
4126 | 4131 |
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 |
4141 || f->phys_cursor_x != curs_x | 4138 || f->phys_cursor_x != curs_x |
4142 || f->phys_cursor_y != curs_y | 4139 || f->phys_cursor_y != curs_y |
4195 return; | 4192 return; |
4196 | 4193 |
4197 /* If cursor is off and we want it off, return quickly. */ | 4194 /* If cursor is off and we want it off, return quickly. */ |
4198 if (!on && f->phys_cursor_x < 0) | 4195 if (!on && f->phys_cursor_x < 0) |
4199 return; | 4196 return; |
4200 | |
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 | 4197 |
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!) |
4212 erase it. */ | 4201 erase it. */ |
4285 | 4274 |
4286 if (updating_frame != f) | 4275 if (updating_frame != f) |
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; |
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; | |
4295 | 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) |
4299 x_display_bar_cursor (f, on); | 4325 x_display_bar_cursor (f, on); |