diff -u -b -p -r1.14 apps_evolution_shell.schemas.in.in
--- shell/apps_evolution_shell.schemas.in.in	21 Apr 2006 18:33:25 -0000	1.14
+++ shell/apps_evolution_shell.schemas.in.in	27 Apr 2006 08:17:27 -0000
@@ -95,6 +95,18 @@
     </schema>
 
     <schema>
+      <key>/schemas/apps/evolution/shell/view_defaults/maximized</key>
+      <applyto>/apps/evolution/shell/view_defaults/maximized</applyto>
+      <owner>evolution</owner>
+      <type>bool</type>
+      <default>TRUE</default>
+      <locale name="C">
+        <short>Default window state</short>
+        <long>Whether or not the window should be maximized.</long>
+      </locale>
+    </schema>
+
+    <schema>
       <key>/schemas/apps/evolution/shell/view_defaults/buttons_visible</key>
       <applyto>/apps/evolution/shell/view_defaults/buttons_visible</applyto>
       <owner>evolution</owner>
diff -u -p -r1.48 e-shell-window.c
--- shell/e-shell-window.c	24 Apr 2006 05:03:49 -0000	1.48
+++ shell/e-shell-window.c	26 Apr 2006 11:01:06 -0000
@@ -116,6 +116,9 @@ struct _EShellWindowPrivate {
 	GtkWidget *offline_toggle;
 	GtkWidget *offline_toggle_image;
 	GtkWidget *menu_hint_label;
+
+	/* The timeout for saving the window size */
+	guint      store_window_size_timer;
 };
 
 
@@ -859,6 +862,69 @@ impl_finalize (GObject *object)
 	(* G_OBJECT_CLASS (e_shell_window_parent_class)->finalize) (object);
 }
 
+/* GtkWidget methods */
+static void
+e_shell_window_remove_resize_timer (EShellWindow* self)
+{
+	if (self->priv->store_window_size_timer) {
+		g_source_remove (self->priv->store_window_size_timer);
+		self->priv->store_window_size_timer = 0;
+	}
+}
+
+static gboolean
+impl_window_state (GtkWidget *widget, GdkEventWindowState* ev)
+{
+	gboolean retval = FALSE;
+
+	/* store only if the window state really changed */
+	if ((ev->changed_mask & GDK_WINDOW_STATE_MAXIMIZED) != 0) {
+		GConfClient* client = gconf_client_get_default ();
+		gconf_client_set_bool (client, "/apps/evolution/shell/view_defaults/maximized",
+				       (ev->new_window_state & GDK_WINDOW_STATE_MAXIMIZED) != 0, NULL);
+		g_object_unref(client);
+	}
+
+	if ((ev->new_window_state & GDK_WINDOW_STATE_MAXIMIZED) != 0) {
+		e_shell_window_remove_resize_timer (E_SHELL_WINDOW (widget));
+	}
+
+	if (GTK_WIDGET_CLASS (e_shell_window_parent_class)->window_state_event) {
+		retval |= GTK_WIDGET_CLASS (e_shell_window_parent_class)->window_state_event (widget, ev);
+	}
+
+	return retval;
+}
+
+static gboolean
+store_window_size (GtkWidget* widget)
+{
+	GConfClient* client = gconf_client_get_default ();
+	gconf_client_set_int (client, "/apps/evolution/shell/view_defaults/width",
+			      widget->allocation.width, NULL);
+	gconf_client_set_int (client, "/apps/evolution/shell/view_defaults/height",
+			      widget->allocation.height, NULL);
+	g_object_unref(client);
+
+	E_SHELL_WINDOW (widget)->priv->store_window_size_timer = 0;
+	return FALSE; // remove this timeout
+}
+
+static void
+impl_size_alloc (GtkWidget* widget, GtkAllocation* alloc)
+{
+	EShellWindow* self = E_SHELL_WINDOW (widget);
+	e_shell_window_remove_resize_timer(self);
+
+	if (GTK_WIDGET_REALIZED(widget) && !(gdk_window_get_state(widget->window) & GDK_WINDOW_STATE_MAXIMIZED)) {
+		/* update the size storage timer */
+		self->priv->store_window_size_timer = g_timeout_add (1000, (GSourceFunc)store_window_size, self);
+	}
+
+	if (GTK_WIDGET_CLASS (e_shell_window_parent_class)->size_allocate) {
+		GTK_WIDGET_CLASS (e_shell_window_parent_class)->size_allocate (widget, alloc);
+	}
+}
 
 /* Initialization.  */
 
@@ -866,10 +932,14 @@ static void
 e_shell_window_class_init (EShellWindowClass *klass)
 {
 	GObjectClass *object_class = G_OBJECT_CLASS (klass);
+	GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
 
 	object_class->dispose  = impl_dispose;
 	object_class->finalize = impl_finalize;
 
+	widget_class->window_state_event = impl_window_state;
+	widget_class->size_allocate      = impl_size_alloc;
+
 	signals[COMPONENT_CHANGED] = g_signal_new ("component_changed",
 						   G_OBJECT_CLASS_TYPE (object_class),
 						   G_SIGNAL_RUN_FIRST,
@@ -951,7 +1021,7 @@ e_shell_window_new (EShell *shell,
 
 	setup_widgets (window);
 
-	if(gconf_client_get_bool (gconf_client_get_default(),"/apps/evolution/shell/view_defaults/sidebar_visible",NULL))
+	if(gconf_client_get_bool (gconf_client,"/apps/evolution/shell/view_defaults/sidebar_visible",NULL))
 		gtk_widget_show (priv->sidebar);
 	else
 		gtk_widget_hide (priv->sidebar);
@@ -977,6 +1047,9 @@ e_shell_window_new (EShell *shell,
 	gtk_window_set_default_size (GTK_WINDOW (window),
 				     gconf_client_get_int (gconf_client, "/apps/evolution/shell/view_defaults/width", NULL),
 				     gconf_client_get_int (gconf_client, "/apps/evolution/shell/view_defaults/height", NULL));
+	if (gconf_client_get_bool (gconf_client, "/apps/evolution/shell/view_defaults/maximized", NULL)) {
+		gtk_window_maximize (GTK_WINDOW (window));
+	}
 
 	g_object_unref (gconf_client);
 	return GTK_WIDGET (window);
@@ -1064,11 +1137,6 @@ e_shell_window_save_defaults (EShellWind
 	char *prop;
 	const char *style;
 	gboolean visible;
-
-	gconf_client_set_int (client, "/apps/evolution/shell/view_defaults/width",
-			      GTK_WIDGET (window)->allocation.width, NULL);
-	gconf_client_set_int (client, "/apps/evolution/shell/view_defaults/height",
-			      GTK_WIDGET (window)->allocation.height, NULL);
 
 	gconf_client_set_int (client, "/apps/evolution/shell/view_defaults/folder_bar/width",
 			      gtk_paned_get_position (GTK_PANED (window->priv->paned)), NULL);
