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. */
XIUngrabDevice (dpyinfo->display, dpyinfo->devices[i].device_id,
CurrentTime);
}
+#endif
#endif
XtDispatchEvent (f->output_data.x->saved_menu_event);
#endif
/* 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;