aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlya Zakharevich2015-08-17 20:15:30 +0300
committerEli Zaretskii2015-08-17 20:15:30 +0300
commitc1f34a993c4ae0f13d5dfc3f1da885e510e931e6 (patch)
treeceb9524a7050416519ab01a90e714898b9a62dd1
parent94cf37c8de3bc14cdadfe84dc8c405a477adbe3e (diff)
downloademacs-c1f34a993c4ae0f13d5dfc3f1da885e510e931e6.tar.gz
emacs-c1f34a993c4ae0f13d5dfc3f1da885e510e931e6.zip
Minor change in variable initialization on MS-Windows
* src/w32fns.c <after_dead_key>: Initialize to -1. (deliver_wm_chars): If after_deadkey is zero, don't set after_dead non-zero.
-rw-r--r--src/w32fns.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/w32fns.c b/src/w32fns.c
index 4b29e64bd58..2cb99c90057 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -2941,7 +2941,11 @@ get_wm_chars (HWND aWnd, int *buf, int buflen, int ignore_ctrl, int ctrl,
2941 environments!) should have different values. Moreover, switching to a 2941 environments!) should have different values. Moreover, switching to a
2942 non-Emacs window with the same language environment, and using (dead)keys 2942 non-Emacs window with the same language environment, and using (dead)keys
2943 there would change the value stored in the kernel, but not this value. */ 2943 there would change the value stored in the kernel, but not this value. */
2944static int after_deadkey = 0; 2944/* A layout may emit deadkey=0. It looks like this would reset the state
2945 of the kernel's finite automaton (equivalent to emiting 0-length string,
2946 which is otherwise impossible in the dead-key map of a layout).
2947 Be ready to treat the case when this delivers WM_(SYS)DEADCHAR. */
2948static int after_deadkey = -1;
2945 2949
2946int 2950int
2947deliver_wm_chars (int do_translate, HWND hwnd, UINT msg, UINT wParam, 2951deliver_wm_chars (int do_translate, HWND hwnd, UINT msg, UINT wParam,
@@ -2951,7 +2955,7 @@ deliver_wm_chars (int do_translate, HWND hwnd, UINT msg, UINT wParam,
2951 points to a keypress. 2955 points to a keypress.
2952 (However, the "old style" TranslateMessage() would deliver at most 16 of 2956 (However, the "old style" TranslateMessage() would deliver at most 16 of
2953 them.) Be on a safe side, and prepare to treat many more. */ 2957 them.) Be on a safe side, and prepare to treat many more. */
2954 int ctrl_cnt, buf[1024], count, is_dead, after_dead = (after_deadkey != -1); 2958 int ctrl_cnt, buf[1024], count, is_dead, after_dead = (after_deadkey > 0);
2955 2959
2956 /* Since the keypress processing logic of Windows has a lot of state, it 2960 /* Since the keypress processing logic of Windows has a lot of state, it
2957 is important to call TranslateMessage() for every keyup/keydown, AND 2961 is important to call TranslateMessage() for every keyup/keydown, AND