[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

Re: Problem in IME control on moving focus between frames.



堀口です. 早速自分のノート(Win95)に持っていったらずっこけてるし^^;
  自己フォローです.

At Mon, 27 Apr 1998 19:10:20 +0900 (JST), : horiguti@xxxxxxxxxxxxx (Kyotaro HORIGUCHI) wrote in <19980427191020E.kyota@xxxxxxxxxxxxx>
>    修正の内容は IMEの状態が変わるたびにフレーム情報にその状態を保
>   存して, フレームが切り替わったときに記憶した状態に戻す処理を追
>   加したというものです.

   95 では w32_display_cursor がむちゃくちゃな頻度で呼ばれるのか, 
  先ほどの修正では Windows95 ではコマンドが入力できなくなってしま
  いました. 不要な切り替えを行わないようにしたらこれもおさまりま
  した.
--
堀口恭太郎.
*** ../../org/Meadow/src/mw32ime.c	Sat Feb 07 01:34:45 1998
--- mw32ime.c	Mon Apr 27 19:38:31 1998
***************
*** 355,366 ****
  void w32_set_ime_status(HWND hwnd, int openp)
  {
    HIMC himc;
  
    himc = (ImmGetContextProc)(hwnd);
    (ImmSetOpenStatusProc)(himc, openp);
    (ImmReleaseContextProc)(hwnd, himc);
! 
    return;
  }
  
  int w32_get_ime_status(HWND hwnd)
--- 355,379 ----
  void w32_set_ime_status(HWND hwnd, int openp)
  {
    HIMC himc;
+   struct frame *f;
  
    himc = (ImmGetContextProc)(hwnd);
    (ImmSetOpenStatusProc)(himc, openp);
    (ImmReleaseContextProc)(hwnd, himc);
!   f = w32_window_to_frame(hwnd);
!   FRAME_W32_IME_STATUS(f) = w32_get_ime_status(hwnd);
    return;
+ }
+ 
+ void w32_restore_ime_status(struct frame *f)
+ {
+   HWND hwnd;
+   int status;
+   
+   hwnd = FRAME_W32_WINDOW(f);
+   status = FRAME_W32_IME_STATUS(f);
+   if (fIME && !NILP (Vime_control) &&  w32_get_ime_status(hwnd) != status)
+     w32_set_ime_status(hwnd, status);
  }
  
  int w32_get_ime_status(HWND hwnd)

*** ../../org/Meadow/src/mw32term.c	Sat Feb 07 19:27:53 1998
--- mw32term.c	Mon Apr 27 16:32:27 1998
***************
*** 3962,3968 ****
  
  #if defined(MEADOW) && defined(IME_CONTROL)
    if ((f == w32_highlight_frame) && on)
!     w32_set_ime_conv_window(f);
  #endif
  
    UNBLOCK_INPUT;
--- 3962,3971 ----
  
  #if defined(MEADOW) && defined(IME_CONTROL)
    if ((f == w32_highlight_frame) && on)
!     {
!       w32_set_ime_conv_window(f);
!       w32_restore_ime_status(f);
!     }
  #endif
  
    UNBLOCK_INPUT;

*** ../../org/Meadow/src/mw32term.h	Sat Feb 07 00:41:13 1998
--- mw32term.h	Mon Apr 27 16:19:11 1998
***************
*** 217,222 ****
--- 217,223 ----
    struct face **param_faces;
    int n_param_faces;
  
+   int ime_status;
  #ifndef TERMINAL_FACE
    /* Table of computed faces for this frame.  These are the faces
       whose indexes go into the upper bits of a glyph, computed by
***************
*** 257,262 ****
--- 258,264 ----
  
  #define FRAME_DESIRED_CURSOR(f) ((f)->output_data.w32->desired_cursor)
  
+ #define FRAME_W32_IME_STATUS(f) ((f)->output_data.w32->ime_status)
  
  /* When X windows are used, a glyph may be a 16 bit unsigned datum.
     The high order byte is the face number and is used as an index