diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2010-07-14 05:18:17 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2010-07-14 05:18:17 +0000 |
commit | d74b2239157d36b8b8795c5eda4bc0315a6ec76e (patch) | |
tree | fd933753ec828c76168a7ba59b4ff3e6146468e0 /src/gtkutils.c | |
parent | d1d309683cf429d32fb5b206b042a1fe9d2490a6 (diff) |
always display fixed-positioned windows on screen.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2615 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/gtkutils.c')
-rw-r--r-- | src/gtkutils.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gtkutils.c b/src/gtkutils.c index 29ce1b7b..75d1e932 100644 --- a/src/gtkutils.c +++ b/src/gtkutils.c @@ -968,6 +968,23 @@ gboolean gtkut_window_modal_exist(void) return exist; } +/* ensure that the window is displayed on screen */ +void gtkut_window_move(GtkWindow *window, gint x, gint y) +{ + gint sx, sy; + + g_return_if_fail(window != NULL); + + if (x < 0) + x = 0; + if (y < 0) + y = 0; + x %= gdk_screen_width(); + y %= gdk_screen_height(); + + gtk_window_move(window, x, y); +} + void gtkut_widget_get_uposition(GtkWidget *widget, gint *px, gint *py) { gint x, y; |