summaryrefslogtreecommitdiffstats
path: root/win/tkWinX.c
diff options
context:
space:
mode:
authorhobbs <hobbs>2006-04-05 19:48:23 (GMT)
committerhobbs <hobbs>2006-04-05 19:48:23 (GMT)
commit15ca07257804122ebaeb81a0eec1d3aa9f8b537e (patch)
tree586010a572b688d822e697526edaa459aabc5daa /win/tkWinX.c
parentc52409cba93b0fbffc5cac8409baf23f28a31da1 (diff)
downloadtk-15ca07257804122ebaeb81a0eec1d3aa9f8b537e.zip
tk-15ca07257804122ebaeb81a0eec1d3aa9f8b537e.tar.gz
tk-15ca07257804122ebaeb81a0eec1d3aa9f8b537e.tar.bz2
* win/tkWinX.c (TkWinXInit): init default keyboard charset
correctly. [Bug 1374119] (pajas)
Diffstat (limited to 'win/tkWinX.c')
-rw-r--r--win/tkWinX.c29
1 files changed, 21 insertions, 8 deletions
diff --git a/win/tkWinX.c b/win/tkWinX.c
index 4b28faa..39339c9 100644
--- a/win/tkWinX.c
+++ b/win/tkWinX.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWinX.c,v 1.25.2.6 2005/02/28 22:10:26 hobbs Exp $
+ * RCS: @(#) $Id: tkWinX.c,v 1.25.2.7 2006/04/05 19:48:23 hobbs Exp $
*/
#include "tkWinInt.h"
@@ -226,6 +226,9 @@ void
TkWinXInit(hInstance)
HINSTANCE hInstance;
{
+ CHARSETINFO lpCs;
+ DWORD lpCP;
+
if (childClassInitialized != 0) {
return;
}
@@ -281,6 +284,17 @@ TkWinXInit(hInstance)
}
/*
+ * Initialize input language info
+ */
+
+ if (GetLocaleInfo(LANGIDFROMLCID(GetKeyboardLayout(0)),
+ LOCALE_IDEFAULTANSICODEPAGE | LOCALE_RETURN_NUMBER,
+ (LPTSTR) &lpCP, sizeof(lpCP)/sizeof(TCHAR))
+ && TranslateCharsetInfo((DWORD *)lpCP, &lpCs, TCI_SRCCODEPAGE)) {
+ UpdateInputLanguage(lpCs.ciCharset);
+ }
+
+ /*
* Make sure we cleanup on finalize.
*/
TkCreateExitHandler(TkWinXCleanup, (ClientData) hInstance);
@@ -1355,13 +1369,12 @@ GetTranslatedKey(xkey)
*
* UpdateInputLanguage --
*
- * Gets called when a WM_INPUTLANGCHANGE message is received
- * by the TK child window procedure. This message is sent
- * by the Input Method Editor system when the user chooses
- * a different input method. All subsequent WM_CHAR
- * messages will contain characters in the new encoding. We record
- * the new encoding so that TkpGetString() knows how to
- * correctly translate the WM_CHAR into unicode.
+ * Gets called when a WM_INPUTLANGCHANGE message is received by the Tk
+ * child window procedure. This message is sent by the Input Method
+ * Editor system when the user chooses a different input method. All
+ * subsequent WM_CHAR messages will contain characters in the new
+ * encoding. We record the new encoding so that TkpGetString() knows how
+ * to correctly translate the WM_CHAR into unicode.
*
* Results:
* Records the new encoding in keyInputEncoding.