aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Colascione2025-06-10 19:49:04 -0700
committerDaniel Colascione2025-06-10 19:49:35 -0700
commitbdefb88b2b71910436a3c78237c503c8b62b4ced (patch)
tree3854863b4e08175669ca7d6cc544057aea6d80ca
parentd3c3bc7379267b538a069a82b9ca9df8ec8f4bac (diff)
downloademacs-dancol/quit-improvements2.tar.gz
emacs-dancol/quit-improvements2.zip
Fix lost C-g events in NS port under loaddancol/quit-improvements2
The NS port was incorrectly reading input events in ns_flush_display, storing them in a local variable that was never processed. This caused C-g (quit) events to be lost when Emacs was under heavy load, making it difficult to interrupt long-running operations. * src/nsterm.m (ns_flush_display): Pass NULL instead of a local variable to ns_read_socket_1, ensuring events are processed normally instead of being discarded. * etc/NEWS: Announce the fix.
-rw-r--r--etc/NEWS5
-rw-r--r--src/nsterm.m8
2 files changed, 9 insertions, 4 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 90b9c7ea9a2..b1f349cc3e5 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -2002,6 +2002,11 @@ determined by the new user option 'pulse-face-duration'.
2002** Miscellaneous 2002** Miscellaneous
2003 2003
2004--- 2004---
2005*** Fixed lost C-g events on NS port under heavy load.
2006The NS port now no longer loses quits when redisplay happens frequently,
2007for example, during certain kinds of heavy IO load.
2008
2009---
2005*** 'tooltip-mode' now shows tooltips after delay on TTY frames. 2010*** 'tooltip-mode' now shows tooltips after delay on TTY frames.
2006Display of tooltips on text-only terminals now happens after 2011Display of tooltips on text-only terminals now happens after
2007'tooltip-delay' as it does on GUI terminals. To get back the old 2012'tooltip-delay' as it does on GUI terminals. To get back the old
diff --git a/src/nsterm.m b/src/nsterm.m
index 003aadb9782..59728aa11b0 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -5487,10 +5487,10 @@ ns_update_window_end (struct window *w, bool cursor_on_p,
5487static void 5487static void
5488ns_flush_display (struct frame *f) 5488ns_flush_display (struct frame *f)
5489{ 5489{
5490 struct input_event ie; 5490 /* Must pass NULL for hold_quit: otherwise,
5491 5491 we lose quits under load because we discard what ends
5492 EVENT_INIT (ie); 5492 up in hold_quit. */
5493 ns_read_socket_1 (FRAME_TERMINAL (f), &ie, YES); 5493 ns_read_socket_1 (FRAME_TERMINAL (f), NULL, YES);
5494} 5494}
5495 5495
5496/* This and next define (many of the) public functions in this 5496/* This and next define (many of the) public functions in this