mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-03-03 04:21:28 -08:00
(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.
This commit is contained in:
parent
a59e4f3d62
commit
37c2c98b16
1 changed files with 21 additions and 8 deletions
29
src/xterm.c
29
src/xterm.c
|
|
@ -291,6 +291,12 @@ XTupdate_begin (f)
|
|||
{
|
||||
/* Don't do highlighting for mouse motion during the update. */
|
||||
FRAME_X_DISPLAY_INFO (f)->mouse_face_defer = 1;
|
||||
|
||||
/* If the frame needs to be redrawn,
|
||||
simply forget about any prior mouse highlighting. */
|
||||
if (! FRAME_GARBAGED_P (f))
|
||||
FRAME_X_DISPLAY_INFO (f)->mouse_face_window = Qnil;
|
||||
|
||||
if (!NILP (FRAME_X_DISPLAY_INFO (f)->mouse_face_window))
|
||||
{
|
||||
int firstline, lastline, i;
|
||||
|
|
@ -311,10 +317,12 @@ XTupdate_begin (f)
|
|||
}
|
||||
|
||||
/* Can we tell that this update does not affect the window
|
||||
where the mouse highlight is? If so, no need to turn off. */
|
||||
where the mouse highlight is? If so, no need to turn off.
|
||||
Likewise, don't do anything if the frame is garbaged;
|
||||
in that case, the FRAME_CURRENT_GLYPHS that we would use
|
||||
are all wrong, and we will redisplay that line anyway. */
|
||||
if (! (firstline > (XFASTINT (w->top) + window_internal_height (w))
|
||||
|| lastline < XFASTINT (w->top)))
|
||||
/* Otherwise turn off the mouse highlight now. */
|
||||
clear_mouse_face (FRAME_X_DISPLAY_INFO (f));
|
||||
}
|
||||
}
|
||||
|
|
@ -1449,6 +1457,16 @@ x_new_focus_frame (frame)
|
|||
XTframe_rehighlight ();
|
||||
}
|
||||
|
||||
/* Handle an event saying the mouse has moved out of an Emacs frame. */
|
||||
|
||||
void
|
||||
x_mouse_leave ()
|
||||
{
|
||||
if (! x_focus_event_frame)
|
||||
x_new_focus_frame (NULL);
|
||||
else
|
||||
x_new_focus_frame (x_focus_event_frame); /* Was f, but that seems wrong. */
|
||||
}
|
||||
|
||||
/* The focus has changed, or we have redirected a frame's focus to
|
||||
another frame (this happens when a frame uses a surrogate
|
||||
|
|
@ -3689,12 +3707,7 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
|
|||
clear_mouse_face (dpyinfo);
|
||||
|
||||
if (event.xcrossing.focus)
|
||||
{
|
||||
if (! x_focus_event_frame)
|
||||
x_new_focus_frame (0);
|
||||
else
|
||||
x_new_focus_frame (f);
|
||||
}
|
||||
x_mouse_leave ();
|
||||
else
|
||||
{
|
||||
if (f == x_focus_event_frame)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue