]> git.eshelyaron.com Git - emacs.git/commitdiff
Work around some problems with Motif and the input extension
authorPo Lu <luangruo@yahoo.com>
Sun, 27 Feb 2022 06:40:26 +0000 (14:40 +0800)
committerPo Lu <luangruo@yahoo.com>
Sun, 27 Feb 2022 06:40:26 +0000 (14:40 +0800)
* src/xmenu.c (create_and_show_popup_menu): Restore input focus
to the frame's outer window if there was an input extension
grab.

src/xmenu.c

index 2bc9f5a93a0d4119e1301f58bc1ca8c5e64f0d68..93bc90514c2a115d4c804b80358e829c9f2a5abd 100644 (file)
@@ -1687,6 +1687,14 @@ create_and_show_popup_menu (struct frame *f, widget_value *first_wv,
 
     unbind_to (specpdl_count, Qnil);
   }
+
+#if defined HAVE_XINPUT2 && defined USE_MOTIF
+  /* For some reason input focus isn't always restored to the outer
+     window after the menu pops down.  */
+  if (any_xi_grab_p)
+    XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
+                   RevertToParent, CurrentTime);
+#endif
 }
 
 #endif /* not USE_GTK */