summaryrefslogtreecommitdiff
path: root/src/w32fns.c
diff options
context:
space:
mode:
authorGeoff Voelker <voelker@cs.washington.edu>1996-11-21 07:48:37 +0000
committerGeoff Voelker <voelker@cs.washington.edu>1996-11-21 07:48:37 +0000
commit3aef7b4e6c6c08d3234ec2102f095708601d4ac7 (patch)
tree785ac2c5e195b82e14c436a413832ac7c39781ff /src/w32fns.c
parentf440d049e8d76d62d7514fea1bf53c2a852b9242 (diff)
downloademacs-3aef7b4e6c6c08d3234ec2102f095708601d4ac7.tar.gz
(w32_wnd_proc): Use dummy message to wake up thread on quit_char.
Diffstat (limited to 'src/w32fns.c')
-rw-r--r--src/w32fns.c23
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)
case WM_CHAR:
wmsg.dwModifiers = construct_modifiers (wParam, lParam);
- enter_crit ();
- my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
-
#if 1
- /* Detect quit_char and set quit-flag directly. Note that we dow
- this *after* posting the message to ensure the main thread will
- be woken up if blocked in sys_select(). */
+ /* Detect quit_char and set quit-flag directly. Note that we
+ still need to post a message to ensure the main thread will be
+ woken up if blocked in sys_select(), but we do NOT want to post
+ the quit_char message itself (because it will usually be as if
+ the user had typed quit_char twice). Instead, we post a dummy
+ message that has no particular effect. */
{
int c = wParam;
if (isalpha (c) && (wmsg.dwModifiers == LEFT_CTRL_PRESSED
|| wmsg.dwModifiers == RIGHT_CTRL_PRESSED))
c = make_ctrl_char (c) & 0377;
if (c == quit_char)
- Vquit_flag = Qt;
+ {
+ Vquit_flag = Qt;
+
+ /* The choice of message is somewhat arbitrary, as long as
+ the main thread handler just ignores it. */
+ msg = WM_QUIT;
+ }
}
#endif
- leave_crit ();
+ my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
+
break;
/* Simulate middle mouse button events when left and right buttons