diff options
| author | Geoff Voelker | 1996-11-21 07:48:37 +0000 |
|---|---|---|
| committer | Geoff Voelker | 1996-11-21 07:48:37 +0000 |
| commit | 3aef7b4e6c6c08d3234ec2102f095708601d4ac7 (patch) | |
| tree | 785ac2c5e195b82e14c436a413832ac7c39781ff | |
| parent | f440d049e8d76d62d7514fea1bf53c2a852b9242 (diff) | |
| download | emacs-3aef7b4e6c6c08d3234ec2102f095708601d4ac7.tar.gz emacs-3aef7b4e6c6c08d3234ec2102f095708601d4ac7.zip | |
(w32_wnd_proc): Use dummy message to wake up thread on quit_char.
| -rw-r--r-- | src/w32fns.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/w32fns.c b/src/w32fns.c index 9891d808c43..6501e49b61e 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -3046,24 +3046,31 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) | |||
| 3046 | case WM_CHAR: | 3046 | case WM_CHAR: |
| 3047 | wmsg.dwModifiers = construct_modifiers (wParam, lParam); | 3047 | wmsg.dwModifiers = construct_modifiers (wParam, lParam); |
| 3048 | 3048 | ||
| 3049 | enter_crit (); | ||
| 3050 | my_post_msg (&wmsg, hwnd, msg, wParam, lParam); | ||
| 3051 | |||
| 3052 | #if 1 | 3049 | #if 1 |
| 3053 | /* Detect quit_char and set quit-flag directly. Note that we dow | 3050 | /* Detect quit_char and set quit-flag directly. Note that we |
| 3054 | this *after* posting the message to ensure the main thread will | 3051 | still need to post a message to ensure the main thread will be |
| 3055 | be woken up if blocked in sys_select(). */ | 3052 | woken up if blocked in sys_select(), but we do NOT want to post |
| 3053 | the quit_char message itself (because it will usually be as if | ||
| 3054 | the user had typed quit_char twice). Instead, we post a dummy | ||
| 3055 | message that has no particular effect. */ | ||
| 3056 | { | 3056 | { |
| 3057 | int c = wParam; | 3057 | int c = wParam; |
| 3058 | if (isalpha (c) && (wmsg.dwModifiers == LEFT_CTRL_PRESSED | 3058 | if (isalpha (c) && (wmsg.dwModifiers == LEFT_CTRL_PRESSED |
| 3059 | || wmsg.dwModifiers == RIGHT_CTRL_PRESSED)) | 3059 | || wmsg.dwModifiers == RIGHT_CTRL_PRESSED)) |
| 3060 | c = make_ctrl_char (c) & 0377; | 3060 | c = make_ctrl_char (c) & 0377; |
| 3061 | if (c == quit_char) | 3061 | if (c == quit_char) |
| 3062 | Vquit_flag = Qt; | 3062 | { |
| 3063 | Vquit_flag = Qt; | ||
| 3064 | |||
| 3065 | /* The choice of message is somewhat arbitrary, as long as | ||
| 3066 | the main thread handler just ignores it. */ | ||
| 3067 | msg = WM_QUIT; | ||
| 3068 | } | ||
| 3063 | } | 3069 | } |
| 3064 | #endif | 3070 | #endif |
| 3065 | 3071 | ||
| 3066 | leave_crit (); | 3072 | my_post_msg (&wmsg, hwnd, msg, wParam, lParam); |
| 3073 | |||
| 3067 | break; | 3074 | break; |
| 3068 | 3075 | ||
| 3069 | /* Simulate middle mouse button events when left and right buttons | 3076 | /* Simulate middle mouse button events when left and right buttons |