summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhobbs <hobbs>2006-04-05 19:48:23 (GMT)
committerhobbs <hobbs>2006-04-05 19:48:23 (GMT)
commit7a24f3c0a1f7ce93b165686a5c7586dce7c47e39 (patch)
tree586010a572b688d822e697526edaa459aabc5daa
parentdfe85a58a2d402b797eb1433c6ac8a83d280a5c2 (diff)
downloadtk-7a24f3c0a1f7ce93b165686a5c7586dce7c47e39.zip
tk-7a24f3c0a1f7ce93b165686a5c7586dce7c47e39.tar.gz
tk-7a24f3c0a1f7ce93b165686a5c7586dce7c47e39.tar.bz2
* win/tkWinX.c (TkWinXInit): init default keyboard charset
correctly. [Bug 1374119] (pajas)
-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.