(M17NLIB_PATCH_LEVEL): Describe it.
[m17n/m17n-lib.git] / src / input-gui.c
index 8d5a0dc..b9a32f9 100644 (file)
@@ -122,6 +122,7 @@ win_create_ic (MInputContext *ic)
 
   win_ic_info->status.win = mwin__create_window (frame, win_info->client);
   win_ic_info->status.control.as_image = 1;
+  win_ic_info->status.control.enable_bidi = 1;
 
   win_ic_info->candidates.win = mwin__create_window (frame, win_info->client);
   win_ic_info->candidates.control.as_image = 1;
@@ -220,16 +221,24 @@ adjust_window_and_draw (MFrame *frame, MInputContext *ic, MText *mt, int type)
     physical.x = win_ic_info->client.geometry.width - physical.width;
   if (type == 0)
     {
-      if (y0 > - ic->spot.ascent)
+      if (len <= 1)
        {
-         physical.height += y0 + ic->spot.ascent;
-         y0 = - ic->spot.ascent;
+         physical.height = physical.width = 1;
+         physical.x = physical.y = -1;
        }
-      if (y1 < ic->spot.descent)
+      else
        {
-         physical.height += ic->spot.descent - y1;
+         if (y0 > - ic->spot.ascent)
+           {
+             physical.height += y0 + ic->spot.ascent;
+             y0 = - ic->spot.ascent;
+           }
+         if (y1 < ic->spot.descent)
+           {
+             physical.height += ic->spot.descent - y1;
+           }
+         physical.y = yoff + ic->spot.y + y0;
        }
-      physical.y = yoff + ic->spot.y + y0;
     }
   else if (type == 1)
     {