From: Po Lu Date: Sun, 27 Feb 2022 06:40:26 +0000 (+0800) Subject: Work around some problems with Motif and the input extension X-Git-Tag: emacs-29.0.90~2093 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=14c80c9db8dd4abf547bfe3e15020fc977e4bdba;p=emacs.git Work around some problems with Motif and the input extension * src/xmenu.c (create_and_show_popup_menu): Restore input focus to the frame's outer window if there was an input extension grab. --- diff --git a/src/xmenu.c b/src/xmenu.c index 2bc9f5a93a0..93bc90514c2 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -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 */