diff options
| author | Daniel Colascione | 2025-06-10 19:49:04 -0700 |
|---|---|---|
| committer | Daniel Colascione | 2025-06-10 19:49:35 -0700 |
| commit | bdefb88b2b71910436a3c78237c503c8b62b4ced (patch) | |
| tree | 3854863b4e08175669ca7d6cc544057aea6d80ca | |
| parent | d3c3bc7379267b538a069a82b9ca9df8ec8f4bac (diff) | |
| download | emacs-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/NEWS | 5 | ||||
| -rw-r--r-- | src/nsterm.m | 8 |
2 files changed, 9 insertions, 4 deletions
| @@ -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. | ||
| 2006 | The NS port now no longer loses quits when redisplay happens frequently, | ||
| 2007 | for 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. |
| 2006 | Display of tooltips on text-only terminals now happens after | 2011 | Display 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, | |||
| 5487 | static void | 5487 | static void |
| 5488 | ns_flush_display (struct frame *f) | 5488 | ns_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 |