From: Po Lu Date: Wed, 2 Mar 2022 01:01:48 +0000 (+0800) Subject: Improve behavior of Motif popup menus on XI2 X-Git-Tag: emacs-29.0.90~2059 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=006a4474551ed43515c6249d2ed4cfcaefd9b7a5;p=emacs.git Improve behavior of Motif popup menus on XI2 * src/xmenu.c (create_and_show_popup_menu): Set input focus to menu window. --- diff --git a/src/xmenu.c b/src/xmenu.c index fb80221e15b..e085fa1ace5 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -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