--text follows this line-- *** Title macOS tool bar button does not gracefully handle successive input events before initial bound command is completed *** Description In Emacs, each tool bar button has associated with it a command that is executed upon a mouse press event. If the command is long running, then it is possible for the button to be repeatedly pressed before a command completes. On macOS, this is problematic as it forces Emacs into the following state: 1. Event processing is handled by AppKit but not returned back to Emacs. - Mouse events are still accepted by the main menu bar, but take no effect on the Emacs event loop. The above is observed in the 30.1 release of macOS, though it may also be an issue with earlier releases. Also noted is that this behavior is not seen with Emacs for Linux 30.1 with PGTK. It is possible to escape the above described state by toggling the input method via the main menu with this selection sequence: Options > Multilingual Environment > Toggle Input Method *** Environment GNU Emacs 30.1 (build 2, aarch64-apple-darwin24.3.0, NS appkit-2575.40 Version 15.3.1 (Build 24D70)) of 2025-02-27 Darwin bingsu.local 24.3.0 Darwin Kernel Version 24.3.0: Thu Jan 2 20:24:16 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6000 arm64 arm Darwin *** Steps to Reproduce 1. Launch GUI Emacs 2. Load the library file cc-tool-bar-bug.el 3. Load the library file foo.el 4. Instrument the function cc/testfn in foo.el for Edebug. 5. Eval the function cc/testfn in foo.el to run it in Edebug. 1. The tool bar should change to have two icons: - The left icon is bound to the command edebug-step-mode - The right icon is bound to the command edebug-top-level-nonstop 6. Call up the Evaluation List Buffer via E 1. Add the variables a and b in cc/testfn to be watched. 7. Use the mouse repeatedly press in rapid fashion the tool bar button bound to edebug-step-mode *** Expected Result Pressing on the tool bar button bound to edebug-step-mode should single step through the function cc/testfn in nominal fashion. *** Actual Result AppKit controls such as the top-level menu are still active but unable to actually work. Emacs.app is unresponsive to keyboard input. This state can be escaped by toggling the input method via the main menu with this selection sequence: Options > Multilingual Environment > Toggle Input Method *** Attached Files