src/windows/native/sun/windows/awt_TextComponent.cpp

Print this page

        

@@ -187,11 +187,12 @@
 }
 
 //im --- override to over the spot composition
 void AwtTextComponent::SetCompositionWindow(RECT& rc)
 {
-    HIMC hIMC = ImmGetContext();
+    HWND hwnd = ImmGetHWnd();
+    HIMC hIMC = ImmGetContext(hwnd);
     // rc is not used for text component.
     COMPOSITIONFORM cf = { CFS_FORCE_POSITION, {0,0}, {0,0,0,0} };
     GetCaretPos(&(cf.ptCurrentPos));
     // the proxy is the native focus owner and it contains the composition window
     // let's convert the position to a coordinate space relative to proxy

@@ -199,10 +200,11 @@
     ImmSetCompositionWindow(hIMC, &cf);
 
     LOGFONT lf;
     GetObject(m_hFont, sizeof(LOGFONT), &lf);
     ImmSetCompositionFont(hIMC, &lf);
+    ImmReleaseContext(hwnd, hIMC);
 }
 //im --- end
 
 LONG AwtTextComponent::getJavaSelPos(LONG orgPos)
 {