summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2021-12-17 19:11:54 +0800
committerPo Lu <luangruo@yahoo.com>2021-12-17 19:11:54 +0800
commit62fc53d75b7e56b4e5f5ce13f16ccdd7a32f2874 (patch)
tree6b5dfe2022dc5f5932415c1eac86d9fd38e4ba89
parent75e6c169ae93bd403bd31bafae6c5a81e2a42ccf (diff)
downloademacs-62fc53d75b7e56b4e5f5ce13f16ccdd7a32f2874.tar.gz
Update menu bar when processing touch sequences on it
* src/xterm.c (handle_one_event): Prevent menu bar from becoming outdated when handling XI_TouchBegin events that may cause it to be opened.
-rw-r--r--src/xterm.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 6f93956e7d9..9f39561fbdb 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -10890,6 +10890,19 @@ handle_one_xevent (struct x_display_info *dpyinfo,
xi_link_touch_point (device, xev->detail, xev->event_x,
xev->event_y);
+ if (FRAME_X_OUTPUT (f)->menubar_widget
+ && xg_event_is_for_menubar (f, event))
+ {
+ bool was_waiting_for_input = waiting_for_input;
+ /* This hack was adopted from the NS port. Whether
+ or not it is actually safe is a different story
+ altogether. */
+ if (waiting_for_input)
+ waiting_for_input = 0;
+ set_frame_menubar (f, true);
+ waiting_for_input = was_waiting_for_input;
+ }
+
inev.ie.kind = TOUCHSCREEN_BEGIN_EVENT;
inev.ie.timestamp = xev->time;
XSETFRAME (inev.ie.frame_or_window, f);