Browse Source

introduced a new config variable ime-hide to hide the ime window. This mechanism doesn't work properly as of now, but hopefully it will soon.

Asad M. Zaman 22 years ago
parent
commit
4805d1285c

+ 2 - 0
panda/src/windisplay/config_windisplay.cxx

@@ -53,6 +53,8 @@ bool ime_composition_w = config_windisplay.GetBool("ime-composition-w", true);
 // IME default windows. This is a mechanism to work around DX8/9 interface
 bool ime_aware = config_windisplay.GetBool("ime-aware", false);
 
+// Set this true to hide ime windows
+bool ime_hide = config_windisplay.GetBool("ime-hide", false);
 
 ////////////////////////////////////////////////////////////////////
 //     Function: init_libwindisplay

+ 1 - 0
panda/src/windisplay/config_windisplay.h

@@ -36,6 +36,7 @@ extern bool hold_keys_across_windows;
 extern bool do_vidmemsize_check;
 extern bool ime_composition_w;
 extern bool ime_aware;
+extern bool ime_hide;
 
 extern EXPCL_PANDAWIN bool sync_video;
 extern EXPCL_PANDAWIN bool swapbuffer_framelock;

+ 8 - 2
panda/src/windisplay/winGraphicsWindow.cxx

@@ -976,7 +976,7 @@ window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
 
         
       case WM_IME_SETCONTEXT:
-        if (!ime_aware)
+        if (!ime_hide)
           break;
 
         windisplay_cat.debug() << "hwnd = " << hwnd << " and GetFocus = " << GetFocus() << endl;
@@ -1003,7 +1003,7 @@ window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
           if (!_ime_open) {
             _ime_active = false;  // Sanity enforcement.
           }
-          if (ime_aware) {
+          if (ime_hide) {
             //if (0) {
             COMPOSITIONFORM comf;
             CANDIDATEFORM canf;
@@ -1085,6 +1085,12 @@ window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
       case WM_IME_ENDCOMPOSITION:
         support_overlay_window(false);
         _ime_active = false;
+
+        if (ime_aware) {
+          wstring ws;
+          _input_devices[0].candidate(ws, 0, 0, 0);
+        }
+          
         break;
         
       case WM_IME_COMPOSITION: