Sorry for the delay, I had to learn how to debug emacs first. According to gdb it only hits that callback function 6 times (after starting emacs, selecting menu items a couple of times, then using the menu to quit emacs). I'm not using wayland yet and was just experimenting with the new pgtk feature and the only issue I had was the menu lag. I'm not sure what else I can offer. I will continue with the regular X build, thanks. On 31/12/2021 21:40, Po Lu wrote: > bhrgunatha writes: > >> Using the new pgtk flag to compile, menu bar items are very slow to >> appear using a mouse e.g. clicking the Tools menu, the menu appears >> after about a second delay. > Could you please set a breakpoint on `menu_bar_button_pressed_cb' in > gtkutil.c, and see how many times it is called? > > That callback being triggered too rapidly seems to be the most likely > problem. > >> Using --with-x-toolkit=gtk3 instead of --with-pgtk does not lag. > By the way, are you running Emacs on Wayland? > > If not, I recommend you use the regular X build instead, since it is > simply superior to the PGTK port. > > Thanks.