[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 2ccb156887: Fix Lucid popup menu being stuck on XI2 builds
From: |
Po Lu |
Subject: |
master 2ccb156887: Fix Lucid popup menu being stuck on XI2 builds |
Date: |
Sun, 26 Dec 2021 20:19:45 -0500 (EST) |
branch: master
commit 2ccb1568876f6ac7d8b980d60d91a689e797ab36
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>
Fix Lucid popup menu being stuck on XI2 builds
* src/xmenu.c (x_activate_menubar): Make some changes
conditional on XI2.
(create_and_show_popup_menu): Clear XI2 grab before showing
popup.
* src/xterm.c (xi_grab_or_ungrab_device): Don't grab device
if popup is activated on Lucid.
---
src/xmenu.c | 12 ++++++++++++
src/xterm.c | 2 +-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/src/xmenu.c b/src/xmenu.c
index 4d969fa25f..9b0353f133 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -449,6 +449,7 @@ x_activate_menubar (struct frame *f)
f->output_data.x->saved_menu_event);
#else
#ifdef USE_MOTIF
+#ifdef HAVE_XINPUT2
struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
/* Clear the XI2 grab so Motif can set a core grab. Otherwise some
versions of Motif will emit a warning and hang. */
@@ -459,6 +460,7 @@ x_activate_menubar (struct frame *f)
XIUngrabDevice (dpyinfo->display, dpyinfo->devices[i].device_id,
CurrentTime);
}
+#endif
#endif
XtDispatchEvent (f->output_data.x->saved_menu_event);
#endif
@@ -1461,7 +1463,17 @@ create_and_show_popup_menu (struct frame *f,
widget_value *first_wv,
/* Don't allow any geometry request from the user. */
XtSetArg (av[ac], (char *) XtNgeometry, 0); ac++;
XtSetValues (menu, av, ac);
+#if defined HAVE_XINPUT2 && defined USE_LUCID
+ struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
+ /* Clear the XI2 grab so lwlib can set a core grab. */
+ if (dpyinfo->num_devices)
+ {
+ for (int i = 0; i < dpyinfo->num_devices; ++i)
+ XIUngrabDevice (dpyinfo->display, dpyinfo->devices[i].device_id,
+ CurrentTime);
+ }
+#endif
/* Display the menu. */
lw_popup_menu (menu, &dummy);
popup_activated_flag = 1;
diff --git a/src/xterm.c b/src/xterm.c
index 8ba4f46c2c..4ca68848d2 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -638,7 +638,7 @@ xi_grab_or_ungrab_device (struct xi_device_t *device,
XISetMask (m, XI_Leave);
if (device->grab
-#ifdef USE_MOTIF
+#if defined USE_MOTIF || defined USE_LUCID
&& !popup_activated ()
#endif
)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 2ccb156887: Fix Lucid popup menu being stuck on XI2 builds,
Po Lu <=