diff options
author | Po Lu <luangruo@yahoo.com> | 2022-03-09 21:29:17 +0800 |
---|---|---|
committer | Po Lu <luangruo@yahoo.com> | 2022-03-09 21:29:17 +0800 |
commit | fe8d49e1add8421afb16f5666bdbbabc7704f9c1 (patch) | |
tree | ce5fad64ced4709e851649984d506af067d8d449 /src/xmenu.c | |
parent | b883e8bc65d314273b63da873e1cdbbac23978e9 (diff) | |
download | emacs-fe8d49e1add8421afb16f5666bdbbabc7704f9c1.tar.gz |
Make XInput 2 features work on GTK 2 builds
* src/xfns.c (setup_xi_event_mask): On GTK 2, select for
button, motion, entry/exit and key events.
* src/xmenu.c (create_and_show_popup_menu): Clear XI grab if
appropriate.
* src/xterm.c (handle_one_xevent): Pass some kinds of input
extension events to GTK manually on versions of GTK+ that don't
understand them.
Diffstat (limited to 'src/xmenu.c')
-rw-r--r-- | src/xmenu.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/xmenu.c b/src/xmenu.c index 4d0e5bd81c2..d19fe13c295 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -1527,6 +1527,23 @@ create_and_show_popup_menu (struct frame *f, widget_value *first_wv, if (i == 5) i = 0; } +#if !defined HAVE_GTK3 && defined HAVE_XINPUT2 + if (FRAME_DISPLAY_INFO (f)->num_devices) + { + for (int i = 0; i < FRAME_DISPLAY_INFO (f)->num_devices; ++i) + { + if (FRAME_DISPLAY_INFO (f)->devices[i].grab) + { + FRAME_DISPLAY_INFO (f)->devices[i].grab = 0; + + XIUngrabDevice (FRAME_X_DISPLAY (f), + FRAME_DISPLAY_INFO (f)->devices[i].device_id, + CurrentTime); + } + } + } +#endif + /* Display the menu. */ gtk_widget_show_all (menu); |