[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master f515ff05e0: Fix mouse face persisting inside Lucid menus on XI2
From: |
Po Lu |
Subject: |
master f515ff05e0: Fix mouse face persisting inside Lucid menus on XI2 |
Date: |
Thu, 5 May 2022 23:56:40 -0400 (EDT) |
branch: master
commit f515ff05e086e74b203b91fb4fba319e24e0fb54
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>
Fix mouse face persisting inside Lucid menus on XI2
* src/xmenu.c (create_and_show_popup_menu): Call `x_mouse_leave'
on Lucid as well when the input extension is being used.
* src/xterm.c (x_mouse_leave): Enable on Lucid XI2 builds.
* src/xterm.h: Update prototypes.
---
src/xmenu.c | 5 +++++
src/xterm.c | 11 ++++++++++-
src/xterm.h | 3 ++-
3 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/src/xmenu.c b/src/xmenu.c
index 0dbc8058f9..4c8828412d 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -1844,6 +1844,11 @@ create_and_show_popup_menu (struct frame *f,
widget_value *first_wv,
#ifdef HAVE_XINPUT2
prepare_for_entry_into_toolkit_menu (f);
+
+#ifdef USE_LUCID
+ if (dpyinfo->supports_xi2)
+ x_mouse_leave (dpyinfo);
+#endif
#endif
/* Display the menu. */
lw_popup_menu (menu, &dummy);
diff --git a/src/xterm.c b/src/xterm.c
index 1f3e44c553..6b5c272ef9 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -10333,12 +10333,21 @@ x_detect_focus_change (struct x_display_info
*dpyinfo, struct frame *frame,
}
-#if !defined USE_X_TOOLKIT && !defined USE_GTK
+#if (defined USE_LUCID && defined HAVE_XINPUT2) \
+ || (!defined USE_X_TOOLKIT && !defined USE_GTK)
/* Handle an event saying the mouse has moved out of an Emacs frame. */
void
x_mouse_leave (struct x_display_info *dpyinfo)
{
+ Mouse_HLInfo *hlinfo = &dpyinfo->mouse_highlight;
+
+ if (hlinfo->mouse_face_mouse_frame)
+ {
+ clear_mouse_face (hlinfo);
+ hlinfo->mouse_face_mouse_frame = NULL;
+ }
+
x_new_focus_frame (dpyinfo, dpyinfo->x_focus_event_frame);
}
#endif
diff --git a/src/xterm.h b/src/xterm.h
index 74e6d1a96c..3e06564bee 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -1386,7 +1386,8 @@ extern bool x_alloc_lighter_color_for_widget (Widget,
Display *, Colormap,
extern bool x_alloc_nearest_color (struct frame *, Colormap, XColor *);
extern void x_query_colors (struct frame *f, XColor *, int);
extern void x_clear_area (struct frame *f, int, int, int, int);
-#if !defined USE_X_TOOLKIT && !defined USE_GTK
+#if (defined USE_LUCID && defined HAVE_XINPUT2) \
+ || (!defined USE_X_TOOLKIT && !defined USE_GTK)
extern void x_mouse_leave (struct x_display_info *);
#endif
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master f515ff05e0: Fix mouse face persisting inside Lucid menus on XI2,
Po Lu <=