diff -uprN /usr/ports/textproc/uim/work/uim-1.6.0/gtk/caret-state-indicator.c uim-1.6.0.patch1/gtk/caret-state-indicator.c --- /usr/ports/textproc/uim/work/uim-1.6.0/gtk/caret-state-indicator.c Fri Dec 22 13:32:35 2006 +++ uim-1.6.0.patch1/gtk/caret-state-indicator.c Mon Jul 30 02:21:43 2007 @@ -178,8 +178,25 @@ caret_state_indicator_update(GtkWidget * g_strfreev(cols); } - gtk_window_move(GTK_WINDOW(window), topwin_x + cursor_x, - topwin_y + cursor_y + 3); + { + gint pos_x = topwin_x + cursor_x; + gint pos_y = topwin_y + cursor_y + 16; + gint size_x, size_y; + gint limit_x, limit_y; + gtk_window_get_size(GTK_WINDOW(window), &size_x, &size_y); + limit_x = gdk_screen_get_width(gdk_screen_get_default()) - size_x; + limit_y = gdk_screen_get_height(gdk_screen_get_default()) - size_y; + if (limit_x < pos_x) { + pos_x -= size_x; + if (limit_x < pos_x) { + pos_x = limit_x; + } + } + if (limit_y < pos_y) { + pos_y -= (16 + size_y + 32); + } + gtk_window_move(GTK_WINDOW(window), pos_x, pos_y); + } } void