aboutsummaryrefslogtreecommitdiff
path: root/src/compose.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-11-22 03:59:35 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-11-22 03:59:35 +0000
commit2cec57786293b83c859c0f00c429dac688a60803 (patch)
tree0b7b2de458b682f920f6b7a02d7d0f4668b5afa8 /src/compose.c
parentde47e5e4a58acf41d5506b90950d6dc9518b4ff8 (diff)
remember the last compose window position.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@769 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/compose.c')
-rw-r--r--src/compose.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/compose.c b/src/compose.c
index 8a12ae3a..d8e7b67b 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -166,6 +166,8 @@ static GList *compose_list = NULL;
static Compose *compose_create (PrefsAccount *account,
ComposeMode mode);
static Compose *compose_find_window_by_target (MsgInfo *msginfo);
+static gboolean compose_window_exist (gint x,
+ gint y);
static void compose_connect_changed_callbacks (Compose *compose);
static GtkWidget *compose_toolbar_create (Compose *compose);
static GtkWidget *compose_account_option_menu_create
@@ -4023,6 +4025,10 @@ static Compose *compose_create(PrefsAccount *account, ComposeMode mode)
gtk_window_set_wmclass(GTK_WINDOW(window), "compose", "Sylpheed");
gtk_window_set_policy(GTK_WINDOW(window), TRUE, TRUE, FALSE);
gtk_widget_set_size_request(window, -1, prefs_common.compose_height);
+ if (!compose_window_exist(prefs_common.compose_x,
+ prefs_common.compose_y))
+ gtk_window_move(GTK_WINDOW(window), prefs_common.compose_x,
+ prefs_common.compose_y);
if (!geometry.max_width) {
geometry.max_width = gdk_screen_width();
@@ -4552,6 +4558,22 @@ static Compose *compose_find_window_by_target(MsgInfo *msginfo)
return NULL;
}
+static gboolean compose_window_exist(gint x, gint y)
+{
+ GList *cur;
+ Compose *compose;
+ gint x_, y_;
+
+ for (cur = compose_list; cur != NULL; cur = cur->next) {
+ compose = cur->data;
+ gtkut_widget_get_uposition(compose->window, &x_, &y_);
+ if (x == x_ && y == y_)
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
static void compose_connect_changed_callbacks(Compose *compose)
{
GtkTextView *text = GTK_TEXT_VIEW(compose->text);
@@ -4995,6 +5017,8 @@ static void compose_destroy(Compose *compose)
if (addressbook_get_target_compose() == compose)
addressbook_set_target_compose(NULL);
+ gtkut_widget_get_uposition(compose->window, &prefs_common.compose_x,
+ &prefs_common.compose_y);
prefs_common.compose_width = compose->scrolledwin->allocation.width;
prefs_common.compose_height = compose->window->allocation.height;