emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 3e64039 09/35: Handle crossing events on xwidget windows correctl


From: Lars Ingebrigtsen
Subject: master 3e64039 09/35: Handle crossing events on xwidget windows correctly
Date: Sat, 6 Nov 2021 22:01:56 -0400 (EDT)

branch: master
commit 3e640399d877908760b11782dcb208721b85d629
Author: Po Lu <luangruo@yahoo.com>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Handle crossing events on xwidget windows correctly
    
    * src/xterm.c (handle_one_xevent): Clear help and mouse face
    when handling xwidget entry events.
    * src/xwidget.c (xwidget_motion_or_crossing): Add device to crossing
    events.
    (x_draw_xwidget_glyph_string): Add EnterWindowMask and
    LeaveWindowMask.
---
 src/xterm.c   | 13 +++++++++++++
 src/xwidget.c |  3 ++-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/src/xterm.c b/src/xterm.c
index fa7dd9b..756a8dd 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -8896,10 +8896,23 @@ handle_one_xevent (struct x_display_info *dpyinfo,
 #ifdef HAVE_XWIDGETS
       {
        struct xwidget_view *xvw = xwidget_view_from_window 
(event->xcrossing.window);
+       Mouse_HLInfo *hlinfo;
 
        if (xvw)
          {
            xwidget_motion_or_crossing (xvw, event);
+           hlinfo = MOUSE_HL_INFO (xvw->frame);
+
+           if (xvw->frame == hlinfo->mouse_face_mouse_frame)
+             {
+               clear_mouse_face (hlinfo);
+               hlinfo->mouse_face_mouse_frame = 0;
+             }
+
+           if (any_help_event_p)
+             {
+               do_help = -1;
+             }
            goto OTHER;
          }
       }
diff --git a/src/xwidget.c b/src/xwidget.c
index c758987..067ff11 100644
--- a/src/xwidget.c
+++ b/src/xwidget.c
@@ -459,6 +459,7 @@ xwidget_motion_or_crossing (struct xwidget_view *view, 
const XEvent *event)
       xg_event->crossing.y = event->xcrossing.y + view->clip_top;
       xg_event->crossing.x_root = event->xcrossing.x_root;
       xg_event->crossing.y_root = event->xcrossing.y_root;
+      gdk_event_set_device (xg_event, find_suitable_pointer (view->frame));
     }
 
   gtk_main_do_event (xg_event);
@@ -947,7 +948,7 @@ x_draw_xwidget_glyph_string (struct glyph_string *s)
       XSETXWIDGET_VIEW (xvw, xv);
       XSetWindowAttributes a;
       a.event_mask = (ExposureMask | ButtonPressMask | ButtonReleaseMask
-                     | PointerMotionMask);
+                     | PointerMotionMask | EnterWindowMask | LeaveWindowMask);
 
       xv->wdesc = XCreateWindow (xv->dpy, FRAME_X_WINDOW (s->f),
                                 x + clip_left, y + clip_top,



reply via email to

[Prev in Thread] Current Thread [Next in Thread]