diff options
| author | Richard M. Stallman | 1994-12-23 05:12:32 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-12-23 05:12:32 +0000 |
| commit | 37c2c98b1659e880f69a2c91c8a135577a0713d6 (patch) | |
| tree | 5d4e0a89d3bf1ff6c9c330ecd42ffe943eced231 /src | |
| parent | a59e4f3d62a637792992f56d9049ab59ccd06dff (diff) | |
| download | emacs-37c2c98b1659e880f69a2c91c8a135577a0713d6.tar.gz emacs-37c2c98b1659e880f69a2c91c8a135577a0713d6.zip | |
(XTupdate_begin): Discard records of prior mouse highlight
when frame must be redrawn.
(x_make_frame_visible, x_make_frame_invisible)
(x_iconify_frame): Give error if frame has explicit_parent.
(x_new_font): Don't set window height if frame has explicit_parent.
(x_mouse_leave): New function broken out of XTread_socket.
When x_focus_event_frame is nonzero, assume that frame gets focus.
(XTread_socket): Use x_mouse_leave for LeaveNotify.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/src/xterm.c b/src/xterm.c index f5d02267450..8abd502854d 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -291,6 +291,12 @@ XTupdate_begin (f) | |||
| 291 | { | 291 | { |
| 292 | /* Don't do highlighting for mouse motion during the update. */ | 292 | /* Don't do highlighting for mouse motion during the update. */ |
| 293 | FRAME_X_DISPLAY_INFO (f)->mouse_face_defer = 1; | 293 | FRAME_X_DISPLAY_INFO (f)->mouse_face_defer = 1; |
| 294 | |||
| 295 | /* If the frame needs to be redrawn, | ||
| 296 | simply forget about any prior mouse highlighting. */ | ||
| 297 | if (! FRAME_GARBAGED_P (f)) | ||
| 298 | FRAME_X_DISPLAY_INFO (f)->mouse_face_window = Qnil; | ||
| 299 | |||
| 294 | if (!NILP (FRAME_X_DISPLAY_INFO (f)->mouse_face_window)) | 300 | if (!NILP (FRAME_X_DISPLAY_INFO (f)->mouse_face_window)) |
| 295 | { | 301 | { |
| 296 | int firstline, lastline, i; | 302 | int firstline, lastline, i; |
| @@ -311,10 +317,12 @@ XTupdate_begin (f) | |||
| 311 | } | 317 | } |
| 312 | 318 | ||
| 313 | /* Can we tell that this update does not affect the window | 319 | /* Can we tell that this update does not affect the window |
| 314 | where the mouse highlight is? If so, no need to turn off. */ | 320 | where the mouse highlight is? If so, no need to turn off. |
| 321 | Likewise, don't do anything if the frame is garbaged; | ||
| 322 | in that case, the FRAME_CURRENT_GLYPHS that we would use | ||
| 323 | are all wrong, and we will redisplay that line anyway. */ | ||
| 315 | if (! (firstline > (XFASTINT (w->top) + window_internal_height (w)) | 324 | if (! (firstline > (XFASTINT (w->top) + window_internal_height (w)) |
| 316 | || lastline < XFASTINT (w->top))) | 325 | || lastline < XFASTINT (w->top))) |
| 317 | /* Otherwise turn off the mouse highlight now. */ | ||
| 318 | clear_mouse_face (FRAME_X_DISPLAY_INFO (f)); | 326 | clear_mouse_face (FRAME_X_DISPLAY_INFO (f)); |
| 319 | } | 327 | } |
| 320 | } | 328 | } |
| @@ -1449,6 +1457,16 @@ x_new_focus_frame (frame) | |||
| 1449 | XTframe_rehighlight (); | 1457 | XTframe_rehighlight (); |
| 1450 | } | 1458 | } |
| 1451 | 1459 | ||
| 1460 | /* Handle an event saying the mouse has moved out of an Emacs frame. */ | ||
| 1461 | |||
| 1462 | void | ||
| 1463 | x_mouse_leave () | ||
| 1464 | { | ||
| 1465 | if (! x_focus_event_frame) | ||
| 1466 | x_new_focus_frame (NULL); | ||
| 1467 | else | ||
| 1468 | x_new_focus_frame (x_focus_event_frame); /* Was f, but that seems wrong. */ | ||
| 1469 | } | ||
| 1452 | 1470 | ||
| 1453 | /* The focus has changed, or we have redirected a frame's focus to | 1471 | /* The focus has changed, or we have redirected a frame's focus to |
| 1454 | another frame (this happens when a frame uses a surrogate | 1472 | another frame (this happens when a frame uses a surrogate |
| @@ -3689,12 +3707,7 @@ XTread_socket (sd, bufp, numchars, waitp, expected) | |||
| 3689 | clear_mouse_face (dpyinfo); | 3707 | clear_mouse_face (dpyinfo); |
| 3690 | 3708 | ||
| 3691 | if (event.xcrossing.focus) | 3709 | if (event.xcrossing.focus) |
| 3692 | { | 3710 | x_mouse_leave (); |
| 3693 | if (! x_focus_event_frame) | ||
| 3694 | x_new_focus_frame (0); | ||
| 3695 | else | ||
| 3696 | x_new_focus_frame (f); | ||
| 3697 | } | ||
| 3698 | else | 3711 | else |
| 3699 | { | 3712 | { |
| 3700 | if (f == x_focus_event_frame) | 3713 | if (f == x_focus_event_frame) |