]> git.eshelyaron.com Git - emacs.git/commitdiff
Handle crossing events on xwidget windows correctly
authorPo Lu <luangruo@yahoo.com>
Fri, 5 Nov 2021 02:22:27 +0000 (10:22 +0800)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 7 Nov 2021 01:59:40 +0000 (02:59 +0100)
* 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
src/xwidget.c

index fa7dd9b9ca01cf562d3f0c62d61c3ddba6e4273c..756a8dd1edf28b04df8822c62eb0d95f0cdce936 100644 (file)
@@ -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;
          }
       }
index c7589871584d5eea511f4771f42a90acbf375101..067ff11002c70ec1241df660b5a36ec5b1f0f878 100644 (file)
@@ -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,