kzkの日記: helper-candwin-gtkが画面からはみ出る 1
ちまたで噂のバグ
--- helper-candwin-gtk.c (revision 990)
+++ helper-candwin-gtk.c (working copy)
@@ -173,12 +173,34 @@
}
+
void
candwin_move(char **str)
{
- int x,y;
- sscanf(str[1],"%d",&x);
- sscanf(str[2],"%d",&y);
+ int x, y;
+ int topwin_x, topwin_y;
+ int cw_wi, cw_he, sc_wi, sc_he;
+
+ sscanf(str[1],"%d",&topwin_x);
+ sscanf(str[2],"%d",&topwin_y);
+
+ gtk_window_get_size(GTK_WINDOW(cwin.window), &cw_wi, &cw_he);
+
+ sc_wi = gdk_screen_get_width (gdk_screen_get_default());
+ sc_he = gdk_screen_get_height(gdk_screen_get_default());
+
+ if(sc_wi topwin_x + cw_wi) {
+ x = topwin_x - cw_wi;
+ } else {
+ x = topwin_x;
+ }
+
+ if(sc_he topwin_y + cw_he) {
+ y = topwin_y - cw_he;
+ } else {
+ y = topwin_y;
+ }
+
gtk_window_move(GTK_WINDOW(cwin.window), x, y );
}
つかこれだと、preeditにcandwinがかかってしまうのよね。
とりあえずcommitしちゃっても良いのかな...
良い解決方法が有るかもしれないので、一応晒しとく。
そしてまた英語一の勉強に戻りますつ....
息抜きに最適なバグでした。
helper-candwin-gtk (スコア:1)