]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve behavior of Motif popup menus on XI2
authorPo Lu <luangruo@yahoo.com>
Wed, 2 Mar 2022 01:01:48 +0000 (09:01 +0800)
committerPo Lu <luangruo@yahoo.com>
Wed, 2 Mar 2022 01:01:48 +0000 (09:01 +0800)
* src/xmenu.c (create_and_show_popup_menu): Set input focus to
menu window.

src/xmenu.c

index fb80221e15b568c0bcddf514d7b3f494e97e2e64..e085fa1ace51cf12f260a07d69950435d645ccc1 100644 (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