From f0c947b5a090d8a6af3077a91a26a3a98787925d Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Sat, 11 Mar 2006 23:46:27 +0000 Subject: [PATCH 1/1] (signal_user_input): New function. (post_character_message): Use it for keyboard input. (w32_msg_pump): Use it for mouse input. --- src/w32fns.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/w32fns.c b/src/w32fns.c index c116c51603..c665bbad7f 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -2694,6 +2694,24 @@ w32_msg_worker (dw) return 0; } +static void +signal_user_input () +{ + /* Interrupt any lisp that wants to be interrupted by input. */ + if (!NILP (Vthrow_on_input)) + { + Vquit_flag = Vthrow_on_input; + /* If we're inside a function that wants immediate quits, + do it now. */ + if (immediate_quit && NILP (Vinhibit_quit)) + { + immediate_quit = 0; + QUIT; + } + } +} + + static void post_character_message (hwnd, msg, wParam, lParam, modifiers) HWND hwnd; @@ -2751,6 +2769,8 @@ post_character_message (hwnd, msg, wParam, lParam, modifiers) to receive C-g to interrupt the lisp thread. */ cancel_all_deferred_msgs (); } + else + signal_user_input (); } my_post_msg (&wmsg, hwnd, msg, wParam, lParam); @@ -3270,6 +3290,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) wmsg.dwModifiers = w32_get_modifiers (); my_post_msg (&wmsg, hwnd, msg, wParam, lParam); + signal_user_input (); /* Need to return true for XBUTTON messages, false for others, to indicate that we processed the message. */ @@ -3324,11 +3345,13 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) case WM_MOUSEWHEEL: wmsg.dwModifiers = w32_get_modifiers (); my_post_msg (&wmsg, hwnd, msg, wParam, lParam); + signal_user_input (); return 0; case WM_DROPFILES: wmsg.dwModifiers = w32_get_modifiers (); my_post_msg (&wmsg, hwnd, msg, wParam, lParam); + signal_user_input (); return 0; case WM_TIMER: @@ -3338,6 +3361,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) if (saved_mouse_button_msg.msg.hwnd) { post_msg (&saved_mouse_button_msg); + signal_user_input (); saved_mouse_button_msg.msg.hwnd = 0; } KillTimer (hwnd, mouse_button_timer); @@ -3840,6 +3864,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) { wmsg.dwModifiers = w32_get_modifiers (); my_post_msg (&wmsg, hwnd, msg, wParam, lParam); + signal_user_input (); return 0; } -- 2.20.1