Improve behavior of Motif popup menus on XI2

* src/xmenu.c (create_and_show_popup_menu): Set input focus to
menu window.
This commit is contained in:
Po Lu
2022-03-02 09:01:48 +08:00
parent caae254bb4
commit 006a447455

View File

@@ -1728,6 +1728,15 @@ create_and_show_popup_menu (struct frame *f, widget_value *first_wv,
/* Display the menu. */
lw_popup_menu (menu, &dummy);
#if defined HAVE_XINPUT2 && defined USE_MOTIF
/* This is needed to prevent XI_Enter events that set an implicit
focus from being sent. */
if (dpyinfo->supports_xi2)
XSetInputFocus (XtDisplay (menu), XtWindow (menu),
RevertToParent, CurrentTime);
#endif
popup_activated_flag = 1;
#if defined HAVE_XINPUT2 && !defined USE_MOTIF