Index: shell/rb-shell.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/shell/rb-shell.c,v
retrieving revision 1.336
diff -u -r1.336 rb-shell.c
--- shell/rb-shell.c	12 Sep 2005 09:19:41 -0000	1.336
+++ shell/rb-shell.c	24 Sep 2005 07:46:55 -0000
@@ -96,6 +96,9 @@
 static gboolean rb_shell_window_state_cb (GtkWidget *widget,
 					  GdkEventWindowState *event,
 					  RBShell *shell);
+static gboolean rb_shell_window_configure_cb (GtkWidget *win,
+					      GdkEventConfigure*event,
+					      RBShell *shell);
 static gboolean rb_shell_window_delete_cb (GtkWidget *win,
 			                   GdkEventAny *event,
 			                   RBShell *shell);
@@ -104,6 +107,7 @@
 static void paned_size_allocate_cb (GtkWidget *widget,
 				    GtkAllocation *allocation,
 				    RBShell *shell);
+static gboolean rb_shell_get_visibility (RBShell *shell);
 static void rb_shell_select_source (RBShell *shell, RBSource *source);
 static RBSource *rb_shell_get_source_by_entry_type (RBShell *shell, 
 						    RhythmDBEntryType type);
@@ -823,6 +827,9 @@
 				 G_CALLBACK (rb_shell_window_state_cb),
 				 shell, 0);
 
+	g_signal_connect_object (G_OBJECT (win), "configure-event",
+				 G_CALLBACK (rb_shell_window_configure_cb),
+				 shell, 0);
 
 	g_signal_connect_object (G_OBJECT (win), "delete_event",
 				 G_CALLBACK (rb_shell_window_delete_cb),
@@ -1113,13 +1120,14 @@
 {
 	shell->priv->iconified = (event->new_window_state & GDK_WINDOW_STATE_ICONIFIED);
 
-	if (event->changed_mask & GDK_WINDOW_STATE_MAXIMIZED) {
-		gboolean show;
-
-		show = !(event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED);
+	if ((event->changed_mask & GDK_WINDOW_STATE_MAXIMIZED) && rb_shell_get_visibility (shell)) {
+		gboolean maximised = event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED;
+		gboolean small = eel_gconf_get_boolean (CONF_UI_SMALL_DISPLAY);
 
 		gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (shell->priv->statusbar),
-						   show);
+						   !maximised);
+		if (!small)
+			eel_gconf_set_boolean (CONF_STATE_WINDOW_MAXIMIZED, maximised);
 	}
 
 	return FALSE;
@@ -1194,6 +1202,23 @@
 
 	g_signal_emit_by_name (shell, "visibility_changed", visible);
 
+}
+
+static gboolean
+rb_shell_window_configure_cb (GtkWidget *win,
+			      GdkEventConfigure *event,
+			      RBShell *shell)
+{
+	gboolean small = eel_gconf_get_boolean (CONF_UI_SMALL_DISPLAY);
+
+	if (small) {
+		eel_gconf_set_integer (CONF_STATE_SMALL_WIDTH, event->width);
+	} else {
+		eel_gconf_set_integer (CONF_STATE_WINDOW_WIDTH, event->width);
+		eel_gconf_set_integer (CONF_STATE_WINDOW_HEIGHT, event->height);
+	}
+
+	return FALSE;
 }
 
 static gboolean
