From: Po Lu Date: Fri, 24 Dec 2021 03:21:21 +0000 (+0000) Subject: Acquire draw lock when updating menubar on Haiku X-Git-Tag: emacs-29.0.90~3481 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fbe026cb3e2f8148dd1841e0f9974915ca32c84d;p=emacs.git Acquire draw lock when updating menubar on Haiku * src/haikumenu.c (digest_menu_items): Acquire draw lock. --- diff --git a/src/haikumenu.c b/src/haikumenu.c index 698da9d639c..2ce0aed1468 100644 --- a/src/haikumenu.c +++ b/src/haikumenu.c @@ -59,10 +59,17 @@ digest_menu_items (void *first_menu, int start, int menu_items_used, menus[0] = first_menu; void *window = NULL; + void *view = NULL; if (FRAMEP (Vmenu_updating_frame) && FRAME_LIVE_P (XFRAME (Vmenu_updating_frame)) && FRAME_HAIKU_P (XFRAME (Vmenu_updating_frame))) - window = FRAME_HAIKU_WINDOW (XFRAME (Vmenu_updating_frame)); + { + window = FRAME_HAIKU_WINDOW (XFRAME (Vmenu_updating_frame)); + view = FRAME_HAIKU_VIEW (XFRAME (Vmenu_updating_frame)); + } + + if (view) + BView_draw_lock (view); while (i < menu_items_used) { @@ -161,6 +168,9 @@ digest_menu_items (void *first_menu, int start, int menu_items_used, i += MENU_ITEMS_ITEM_LENGTH; } } + + if (view) + BView_draw_unlock (view); } static Lisp_Object