diff options
author | Don Kjer <don@lindenlab.com> | 2007-11-09 01:56:15 +0000 |
---|---|---|
committer | Don Kjer <don@lindenlab.com> | 2007-11-09 01:56:15 +0000 |
commit | c1920e3c1c60fb792cf091750b05de618b355878 (patch) | |
tree | 204b78e0f0b87fb2875b90af0f579d53e3138cbb /indra/llwindow/llwindowwin32.cpp | |
parent | 760f2ceb1518d87e865f25ac87a540625e974517 (diff) |
EFFECTIVE MERGE: svn merge -r 70833:71458 svn+ssh://svn/svn/linden/branches/maintenance-2 into release
ACTUAL MERGE: svn merge -r 73210:73222 svn+ssh://svn/svn/linden/qa/maintenance-2-merge-73206 into release
Diffstat (limited to 'indra/llwindow/llwindowwin32.cpp')
-rw-r--r-- | indra/llwindow/llwindowwin32.cpp | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index bb99d4c7b5..0286623662 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -92,6 +92,7 @@ BOOL LLWindowWin32::sLanguageTextInputAllowed = TRUE; HKL LLWindowWin32::sWinInputLocale = 0; DWORD LLWindowWin32::sWinIMEConversionMode = IME_CMODE_NATIVE; DWORD LLWindowWin32::sWinIMESentenceMode = IME_SMODE_AUTOMATIC; +LLCoordWindow LLWindowWin32::sWinIMEWindowPosition(-1,-1); // The following class LLWinImm delegates Windows IMM APIs. // We need this because some language versions of Windows, @@ -3372,14 +3373,15 @@ void LLWindowWin32::allowLanguageTextInput(BOOL b) // Put the IME window at the right place (near current text input). Point coordinates should be the top of the current text line. void LLWindowWin32::setLanguageTextInput( const LLCoordGL & position ) { - if (sLanguageTextInputAllowed && LLWinImm::isAvailable()) - { + if ( LLWinImm::isAvailable() ) + { HIMC himc = LLWinImm::getContext(mWindowHandle); LLCoordWindow win_pos; convertCoords( position, &win_pos ); - if ( win_pos.mX >= 0 && win_pos.mY >= 0 ) + if ( win_pos.mX >= 0 && win_pos.mY >= 0 && + (win_pos.mX >= 0 != sWinIMEWindowPosition.mX ) || (win_pos.mY >= 0 != sWinIMEWindowPosition.mY ) ) { COMPOSITIONFORM ime_form; memset( &ime_form, 0, sizeof(ime_form) ); @@ -3388,10 +3390,27 @@ void LLWindowWin32::setLanguageTextInput( const LLCoordGL & position ) ime_form.ptCurrentPos.y = win_pos.mY; LLWinImm::setCompositionWindow( himc, &ime_form ); + + sWinIMEWindowPosition.set( win_pos.mX, win_pos.mY ); } - LLWinImm::releaseContext(mWindowHandle, himc); + // Input not allowed, make sure it's set to alpha numeric mode + if ( !sLanguageTextInputAllowed ) + { + if ( LLWinImm::getOpenStatus(himc) ) + { + DWORD conversion_mode = 0; + DWORD sentence_mode = 0; + LLWinImm::getConversionStatus(himc, &conversion_mode, &sentence_mode); + if ( conversion_mode != IME_CMODE_ALPHANUMERIC ) + { // Set to no-conversion mode instead of turning it off + LLWinImm::setConversionStatus(himc, IME_CMODE_ALPHANUMERIC, IME_SMODE_NONE ); + } + } + } + + LLWinImm::releaseContext(mWindowHandle, himc); } } |