From ee4f0d1bb0e5413335ac2fa4d582a726abc7c3c7 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 14 Jun 2025 11:57:42 +0300 Subject: [PATCH] Support 'C-g C-g C-g' "urgent quit" feature on MS-Windows * src/w32fns.c (post_character_message): Support triple-C-g. (Bug#78737) (cherry picked from commit 3927402af0affcb13989a7afbacb5107badb9f80) --- src/w32fns.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/w32fns.c b/src/w32fns.c index d96c051f30d..493f33486fb 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -3977,6 +3977,13 @@ post_character_message (HWND hwnd, UINT msg, || (wmsg.dwModifiers == 0 && w32_quit_key && wParam == w32_quit_key)) { + /* See keyboard.c:handle_interrupt. We repeat the same code + here to support the triple-C-g feature. */ + static int force_quit_count; + int count = NILP (Vquit_flag) ? 1 : force_quit_count + 1; + force_quit_count = count; + if (count == 3) + Vinhibit_quit = Qnil; Vquit_flag = Qt; /* The choice of message is somewhat arbitrary, as long as -- 2.39.5