diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2006-03-01 08:42:04 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2006-03-01 08:42:04 +0000 |
commit | f632fff2b4dc230f7c9ce10681444fcacc301ba1 (patch) | |
tree | fde7e29e9fab54c92261f6967eb79dd0e7247706 | |
parent | 14d7714988f2f3887fdef04a7e18d701b3ee1912 (diff) |
place alert dialog center if it is out of range.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1018 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | ChangeLog.ja | 6 | ||||
-rw-r--r-- | src/alertpanel.c | 16 |
3 files changed, 28 insertions, 0 deletions
@@ -1,5 +1,11 @@ 2006-03-01 + * src/alertpanel.c: place dialog center if it is out of range (fixes + main window becomes not responsive when alert dialog is shown while + it is minimized on win32). + +2006-03-01 + * src/main.c: win32: do console initialization only once. 2006-02-28 diff --git a/ChangeLog.ja b/ChangeLog.ja index 9865570e..535ea4fe 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,5 +1,11 @@ 2006-03-01 + * src/alertpanel.c: ダイアログが範囲外の位置にあれば中央に配置する + ようにした(win32 においてメインウィンドウが最小化されているときに + 警告ダイアログが表示された場合操作不能になるのを修正)。 + +2006-03-01 + * src/main.c: win32: コンソールの初期化を一度だけしか行わないように した。 diff --git a/src/alertpanel.c b/src/alertpanel.c index 91e1559d..9e1313a8 100644 --- a/src/alertpanel.c +++ b/src/alertpanel.c @@ -29,6 +29,7 @@ #include <gdk/gdkkeysyms.h> #include "alertpanel.h" +#include "mainwindow.h" #include "manage_window.h" #include "utils.h" #include "gtkutils.h" @@ -169,9 +170,24 @@ void alertpanel_error(const gchar *format, ...) static void alertpanel_show(void) { + gint x, y, w, h, sx, sy; value = G_ALERTWAIT; inc_lock(); + + sx = gdk_screen_width(); + sy = gdk_screen_height(); + gdk_window_get_origin(dialog->window, &x, &y); + w = dialog->allocation.width; + h = dialog->allocation.height; + if (x < 0 || y < 0 || x + w > sx || y + h > sy) { + debug_print("sx, sy, x, y, w, h = %d, %d, %d, %d, %d, %d\n", + sx, sy, x, y, w, h); + debug_print("alert dialog position out of range\n"); + gtk_window_set_position(GTK_WINDOW(dialog), + GTK_WIN_POS_CENTER_ALWAYS); + } + while ((value & G_ALERT_VALUE_MASK) == G_ALERTWAIT) gtk_main_iteration(); |