summaryrefslogtreecommitdiff
path: root/src/haikumenu.c
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2022-04-13 00:47:00 +0000
committerPo Lu <luangruo@yahoo.com>2022-04-13 00:51:13 +0000
commit2e0a2ecc294aa2273ffbef27f49706db2cf40062 (patch)
treedac4ecc80fb38252570fc8efabfbd3bf639a2cdb /src/haikumenu.c
parent33cc12498b0f9191437d1f273d0467d0f69d48f3 (diff)
downloademacs-2e0a2ecc294aa2273ffbef27f49706db2cf40062.tar.gz
Fix freezes when trying to accelerate menu bar on Haiku
* src/haiku_support.cc (class EmacsWindow): New field `menus_begun'. (MenusBeginning): Don't send menu bar open events when that is set, instead set it to true. (BMenuBar_start_tracking): Stop locking the menu bar here and send a special BE_MENU_BAR_OPEN event instead. * src/haiku_support.h (struct haiku_menu_bar_state_event): Delete field `no_lock'. * src/haikumenu.c (Fhaiku_menu_bar_open): * src/haikuterm.c (haiku_read_socket): Update accordingly.
Diffstat (limited to 'src/haikumenu.c')
-rw-r--r--src/haikumenu.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/haikumenu.c b/src/haikumenu.c
index 4cee69826da..22e9c4ecad3 100644
--- a/src/haikumenu.c
+++ b/src/haikumenu.c
@@ -752,19 +752,24 @@ the position of the last non-menu event instead. */)
(Lisp_Object frame)
{
struct frame *f = decode_window_system_frame (frame);
+ int rc;
if (FRAME_EXTERNAL_MENU_BAR (f))
{
block_input ();
set_frame_menubar (f, 1);
- BMenuBar_start_tracking (FRAME_HAIKU_MENU_BAR (f));
+ rc = BMenuBar_start_tracking (FRAME_HAIKU_MENU_BAR (f));
unblock_input ();
+
+ if (!rc)
+ return Qnil;
+
+ FRAME_OUTPUT_DATA (f)->menu_bar_open_p = 1;
+ popup_activated_p += 1;
}
else
- {
- return call2 (Qpopup_menu, call0 (Qmouse_menu_bar_map),
- last_nonmenu_event);
- }
+ return call2 (Qpopup_menu, call0 (Qmouse_menu_bar_map),
+ last_nonmenu_event);
return Qnil;
}