commit 2d6b5f237b167989b96302b8447333dc94e082f6
Author: Ray Strode <rstrode@redhat.com>
Date:   Mon Nov 3 17:19:13 2008 -0500

    Don't slide panel down until applets load

diff --git a/gnome-panel/applet.c b/gnome-panel/applet.c
index 165ded5..53be8e4 100644
--- a/gnome-panel/applet.c
+++ b/gnome-panel/applet.c
@@ -792,6 +792,7 @@ typedef struct {
 } PanelAppletToLoad;
 
 static GSList  *panel_applets_to_load = NULL;
+static GSList  *panel_applets_loading = NULL;
 static gboolean panel_applet_have_load_idle = FALSE;
 
 static void
@@ -819,6 +820,52 @@ panel_applet_on_load_queue (const char *id)
 }
 
 static gboolean
+initially_unhide_toplevels (void)
+{
+	GSList *toplevels, *l;
+
+	toplevels = panel_toplevel_list_toplevels ();
+
+	l = toplevels;
+	while (l != NULL) {
+		PanelToplevel *toplevel;
+
+		toplevel = (PanelToplevel *) l->data;
+
+		panel_toplevel_queue_initial_unhide (toplevel);
+		l = l->next;
+	}
+
+	return FALSE;
+}
+
+void
+panel_applet_stop_loading (const char *id)
+{
+	PanelAppletToLoad *applet;
+	GSList *l, *applet_link;
+
+	applet_link = NULL;
+	for (l = panel_applets_loading; l; l = l->next) {
+		applet = l->data;
+
+		if (strcmp (applet->id, id) == 0) {
+			break;
+		}
+	}
+
+	if (l == NULL)
+		return;
+
+	panel_applets_loading = g_slist_delete_link (panel_applets_loading, l);
+	free_applet_to_load (applet);
+
+	if (panel_applets_loading == NULL) {
+		initially_unhide_toplevels ();
+	}
+}
+
+static gboolean
 panel_applet_load_idle_handler (gpointer dummy)
 {
 	PanelAppletToLoad *applet = NULL;
@@ -848,8 +895,8 @@ panel_applet_load_idle_handler (gpointer dummy)
 		panel_applet_have_load_idle = FALSE;
 		return FALSE;
 	}
-
 	panel_applets_to_load = g_slist_delete_link (panel_applets_to_load, l);
+	panel_applets_loading = g_slist_append (panel_applets_loading, applet);
 
 	panel_widget = panel_toplevel_get_panel_widget (toplevel);
 
@@ -873,6 +920,7 @@ panel_applet_load_idle_handler (gpointer dummy)
 					applet->locked,
 					applet->position,
 					applet->id);
+		panel_applet_stop_loading (applet->id);
 		break;
 	case PANEL_OBJECT_MENU:
 		panel_menu_button_load_from_gconf (panel_widget,
@@ -880,12 +928,14 @@ panel_applet_load_idle_handler (gpointer dummy)
 						   applet->position,
 						   TRUE,
 						   applet->id);
+		panel_applet_stop_loading (applet->id);
 		break;
 	case PANEL_OBJECT_LAUNCHER:
 		launcher_load_from_gconf (panel_widget,
 					  applet->locked,
 					  applet->position,
 					  applet->id);
+		panel_applet_stop_loading (applet->id);
 		break;
 	case PANEL_OBJECT_LOGOUT:
 	case PANEL_OBJECT_LOCK:
@@ -896,6 +946,7 @@ panel_applet_load_idle_handler (gpointer dummy)
 				applet->position,
 				TRUE,
 				applet->id);
+		panel_applet_stop_loading (applet->id);
 		break;
 	case PANEL_OBJECT_ACTION:
 		panel_action_button_load_from_gconf (
@@ -904,6 +955,7 @@ panel_applet_load_idle_handler (gpointer dummy)
 				applet->position,
 				TRUE,
 				applet->id);
+		panel_applet_stop_loading (applet->id);
 		break;
 	case PANEL_OBJECT_MENU_BAR:
 		panel_menu_bar_load_from_gconf (
@@ -912,18 +964,18 @@ panel_applet_load_idle_handler (gpointer dummy)
 				applet->position,
 				TRUE,
 				applet->id);
+		panel_applet_stop_loading (applet->id);
 		break;
 	case PANEL_OBJECT_SEPARATOR:
 		panel_separator_load_from_gconf (panel_widget,
 						 applet->locked,
 						 applet->position,
 						 applet->id);
+		panel_applet_stop_loading (applet->id);
 	default:
 		break;
 	}
 
-	free_applet_to_load (applet);
-
 	return TRUE;
 }
 
@@ -971,8 +1023,10 @@ panel_applet_compare (const PanelAppletToLoad *a,
 void
 panel_applet_load_queued_applets (void)
 {
-	if (!panel_applets_to_load)
+	if (!panel_applets_to_load) {
+		g_idle_add (initially_unhide_toplevels, NULL);
 		return;
+        }
 
 	panel_applets_to_load = g_slist_sort (panel_applets_to_load,
 					      (GCompareFunc) panel_applet_compare);
diff --git a/gnome-panel/applet.h b/gnome-panel/applet.h
index 8790229..16cfa46 100644
--- a/gnome-panel/applet.h
+++ b/gnome-panel/applet.h
@@ -53,6 +53,7 @@ AppletInfo *panel_applet_register    (GtkWidget       *applet,
 				      gboolean         exactpos,
 				      PanelObjectType  type,
 				      const char      *id);
+void panel_applet_stop_loading (const char *id);
 
 const char *panel_applet_get_id           (AppletInfo      *info);
 const char *panel_applet_get_id_by_widget (GtkWidget       *widget);
diff --git a/gnome-panel/panel-applet-frame.c b/gnome-panel/panel-applet-frame.c
index 58f4fb2..8aafd83 100644
--- a/gnome-panel/panel-applet-frame.c
+++ b/gnome-panel/panel-applet-frame.c
@@ -1269,6 +1269,7 @@ panel_applet_frame_activated (CORBA_Object  object,
 		g_warning (G_STRLOC ": failed to load applet %s:\n%s",
 			   frame->priv->iid, error_reason);
 		panel_applet_frame_loading_failed (frame, frame_act->id);
+		panel_applet_stop_loading (frame_act->id);
 		g_free (frame_act->id);
 		g_free (frame_act);
 		return;
@@ -1311,6 +1312,7 @@ panel_applet_frame_activated (CORBA_Object  object,
 		panel_applet_frame_loading_failed (frame, frame_act->id);
 		CORBA_exception_free (&corba_ev);
 		bonobo_object_release_unref (object, NULL);
+		panel_applet_stop_loading (frame_act->id);
                 g_free (frame_act->id);
 		g_free (frame_act);
 		g_free (error);
@@ -1327,6 +1329,7 @@ panel_applet_frame_activated (CORBA_Object  object,
 		g_warning (G_STRLOC ": failed to load applet %s",
 			   frame->priv->iid);
 		panel_applet_frame_loading_failed (frame, frame_act->id);
+		panel_applet_stop_loading (frame_act->id);
 		g_free (frame_act->id);
 		g_free (frame_act);
 		return;
@@ -1338,6 +1341,7 @@ panel_applet_frame_activated (CORBA_Object  object,
 			   "(cannot get control frame)", frame->priv->iid);
 		panel_applet_frame_loading_failed (frame, frame_act->id);
 		gtk_object_sink (GTK_OBJECT (widget));
+		panel_applet_stop_loading (frame_act->id);
 		g_free (frame_act->id);
 		g_free (frame_act);
 		return;
@@ -1354,6 +1358,7 @@ panel_applet_frame_activated (CORBA_Object  object,
 			   frame->priv->iid, error);
 		panel_applet_frame_loading_failed (frame, frame_act->id);
 		gtk_object_sink (GTK_OBJECT (widget));
+		panel_applet_stop_loading (frame_act->id);
 		g_free (frame_act->id);
 		g_free (frame_act);
 		g_free (error);
@@ -1377,6 +1382,7 @@ panel_applet_frame_activated (CORBA_Object  object,
 			   frame->priv->iid, error);
 		panel_applet_frame_loading_failed (frame, frame_act->id);
 		gtk_object_sink (GTK_OBJECT (widget));
+		panel_applet_stop_loading (frame_act->id);
 		g_free (frame_act->id);
 		g_free (frame_act);
 		g_free (error);
@@ -1401,6 +1407,7 @@ panel_applet_frame_activated (CORBA_Object  object,
 			   "(cannot get control)", frame->priv->iid);
 		panel_applet_frame_loading_failed (frame, frame_act->id);
 		gtk_object_sink (GTK_OBJECT (widget));
+		panel_applet_stop_loading (frame_act->id);
 		g_free (frame_act->id);
 		g_free (frame_act);
 		return;
@@ -1413,6 +1420,7 @@ panel_applet_frame_activated (CORBA_Object  object,
 			   "(cannot get applet shell)", frame->priv->iid);
 		panel_applet_frame_loading_failed (frame, frame_act->id);
 		gtk_object_sink (GTK_OBJECT (widget));
+		panel_applet_stop_loading (frame_act->id);
 		g_free (frame_act->id);
 		g_free (frame_act);
 		return;
@@ -1444,6 +1452,7 @@ panel_applet_frame_activated (CORBA_Object  object,
 	panel_lockdown_notify_add (G_CALLBACK (panel_applet_frame_sync_menu_state),
 				   frame);
 
+	panel_applet_stop_loading (frame_act->id);
 	g_free (frame_act->id);
 	g_free (frame_act);
 }
diff --git a/gnome-panel/panel-toplevel.c b/gnome-panel/panel-toplevel.c
index 5d8b8d4..37fc5f0 100644
--- a/gnome-panel/panel-toplevel.c
+++ b/gnome-panel/panel-toplevel.c
@@ -2900,10 +2900,14 @@ panel_toplevel_initially_hide (PanelToplevel *toplevel)
 	if (!toplevel->priv->attached) {
 		toplevel->priv->initial_animation_done = FALSE;
 
+		/* We start the panel off hidden until all the
+		 * applets are loaded, and then finally slide i
+		 * down when it's ready to be used
+		 */
 		toplevel->priv->state = PANEL_STATE_AUTO_HIDDEN;
 		gtk_widget_queue_resize (GTK_WIDGET (toplevel));
 
-		panel_toplevel_queue_auto_unhide (toplevel);
+		panel_toplevel_update_struts (toplevel, FALSE);
 	} else
 		toplevel->priv->initial_animation_done = TRUE;
 
@@ -3638,6 +3642,17 @@ panel_toplevel_queue_auto_unhide (PanelToplevel *toplevel)
 				    toplevel);
 }
 
+void
+panel_toplevel_queue_initial_unhide (PanelToplevel *toplevel)
+{
+	if (toplevel->priv->initial_animation_done)
+		return;
+       /* Give the applets a second or so to frob after registering */
+	toplevel->priv->unhide_timeout =
+		g_timeout_add_seconds (1, (GSourceFunc) panel_toplevel_auto_unhide_timeout_handler,
+			toplevel);
+}
+
 static gboolean
 panel_toplevel_enter_notify_event (GtkWidget        *widget,
 				   GdkEventCrossing *event)
diff --git a/gnome-panel/panel-toplevel.h b/gnome-panel/panel-toplevel.h
index 81e6c76..60400ea 100644
--- a/gnome-panel/panel-toplevel.h
+++ b/gnome-panel/panel-toplevel.h
@@ -136,6 +136,7 @@ void                 panel_toplevel_hide                   (PanelToplevel
 void                 panel_toplevel_unhide                 (PanelToplevel       *toplevel);
 void                 panel_toplevel_queue_auto_hide        (PanelToplevel       *toplevel);
 void                 panel_toplevel_queue_auto_unhide      (PanelToplevel       *toplevel);
+void                 panel_toplevel_queue_initial_unhide   (PanelToplevel       *toplevel);
 void                 panel_toplevel_push_autohide_disabler (PanelToplevel       *toplevel);
 void                 panel_toplevel_pop_autohide_disabler  (PanelToplevel       *toplevel);
 

commit 2c3e3ad9f93a2b17e2a251913e48d154d15ef93e
Author: Ray Strode <rstrode@redhat.com>
Date:   Mon Nov 3 11:50:16 2008 -0500

    Split animation end side calculation to new func
    
    We're going to need it in other places than
    start_animation.

diff --git a/gnome-panel/panel-toplevel.c b/gnome-panel/panel-toplevel.c
index 37fc5f0..0962659 100644
--- a/gnome-panel/panel-toplevel.c
+++ b/gnome-panel/panel-toplevel.c
@@ -3338,22 +3338,19 @@ panel_toplevel_get_animation_time (PanelToplevel *toplevel)
 }
 
 static void
-panel_toplevel_start_animation (PanelToplevel *toplevel)
+panel_toplevel_calculate_animation_end_geometry (PanelToplevel *toplevel)
 {
 	GdkScreen *screen;
 	int        monitor_width, monitor_height;
-	int        deltax, deltay, deltaw = 0, deltah = 0;
-	int        cur_x = -1, cur_y = -1;
-	long       t;
-
-	screen = panel_toplevel_get_monitor_geometry (
-				toplevel, NULL, NULL, &monitor_width, &monitor_height);
 
 	toplevel->priv->animation_end_x      = toplevel->priv->x;
 	toplevel->priv->animation_end_y      = toplevel->priv->y;
 	toplevel->priv->animation_end_width  = -1;
 	toplevel->priv->animation_end_height = -1;
 
+	screen = panel_toplevel_get_monitor_geometry (
+				toplevel, NULL, NULL, &monitor_width, &monitor_height);
+
 	if (!toplevel->priv->expand) {
 
 		if (toplevel->priv->x_centered)
@@ -3384,6 +3381,18 @@ panel_toplevel_start_animation (PanelToplevel *toplevel)
 						       &toplevel->priv->animation_end_width,
 						       &toplevel->priv->animation_end_height);
 
+}
+
+static void
+panel_toplevel_start_animation (PanelToplevel *toplevel)
+{
+	GdkScreen *screen;
+	int        deltax, deltay, deltaw = 0, deltah = 0;
+	int        cur_x = -1, cur_y = -1;
+	long       t;
+
+	panel_toplevel_calculate_animation_end_geometry (toplevel);
+
 	toplevel->priv->animating = TRUE;
 
 	panel_toplevel_update_struts (toplevel, TRUE);
@@ -3396,6 +3405,8 @@ panel_toplevel_start_animation (PanelToplevel *toplevel)
 
 	gdk_window_get_origin (GTK_WIDGET (toplevel)->window, &cur_x, &cur_y);
 
+	screen = gtk_widget_get_screen (GTK_WIDGET (toplevel));
+
 	cur_x -= panel_multiscreen_x (screen, toplevel->priv->monitor);
 	cur_y -= panel_multiscreen_y (screen, toplevel->priv->monitor);
 

commit 36b97aa7bb302b65f554c370d7e8c58af4386a76
Author: Ray Strode <rstrode@redhat.com>
Date:   Mon Nov 3 17:20:09 2008 -0500

    Don't change struts while animating

diff --git a/gnome-panel/panel-toplevel.c b/gnome-panel/panel-toplevel.c
index 0962659..bef6a02 100644
--- a/gnome-panel/panel-toplevel.c
+++ b/gnome-panel/panel-toplevel.c
@@ -188,7 +188,8 @@ struct _PanelToplevelPrivate {
 	/* flag to see if we have already done geometry updating,
 	   if not then we're still loading and can ignore many things */
 	guint                   updated_geometry_initial : 1;
-	/* flag to see if we have done the initial animation */
+	/* flags to see if we have done the initial animation */
+	guint                   initial_animation_started : 1;
 	guint                   initial_animation_done : 1;
 };
 
@@ -231,6 +232,8 @@ enum {
 static guint         toplevel_signals [LAST_SIGNAL] = { 0 };
 static GSList       *toplevel_list = NULL;
 
+static void panel_toplevel_calculate_animation_end_geometry (PanelToplevel *toplevel);
+
 GSList *
 panel_toplevel_list_toplevels (void)
 {
@@ -1372,7 +1375,7 @@ panel_toplevel_get_effective_auto_hide_size (PanelToplevel *toplevel)
 }
 
 static gboolean
-panel_toplevel_update_struts (PanelToplevel *toplevel, gboolean end_of_animation)
+panel_toplevel_update_struts (PanelToplevel *toplevel)
 {
 	PanelOrientation  orientation;
 	GdkScreen        *screen;
@@ -1382,6 +1385,8 @@ panel_toplevel_update_struts (PanelToplevel *toplevel, gboolean end_of_animation
 	int               monitor_x, monitor_y;
 	int               monitor_width, monitor_height;
 
+	panel_toplevel_calculate_animation_end_geometry (toplevel);
+
 	if (!toplevel->priv->updated_geometry_initial)
 		return FALSE;
 
@@ -1397,25 +1402,18 @@ panel_toplevel_update_struts (PanelToplevel *toplevel, gboolean end_of_animation
 						      &monitor_width,
 						      &monitor_height);
 
-	if (end_of_animation) {
-		x = toplevel->priv->animation_end_x;
-		y = toplevel->priv->animation_end_y;
-		x += panel_multiscreen_x (screen, toplevel->priv->monitor);
-		x += panel_multiscreen_y (screen, toplevel->priv->monitor);
-		if (toplevel->priv->animation_end_width != -1)
-			width = toplevel->priv->animation_end_width;
-		else
-			width = toplevel->priv->geometry.width;
-		if (toplevel->priv->animation_end_height != -1)
-			height = toplevel->priv->animation_end_height;
-		else
-			height = toplevel->priv->geometry.height;
-	} else {
-		x      = toplevel->priv->geometry.x;
-		y      = toplevel->priv->geometry.y;
-		width  = toplevel->priv->geometry.width;
+	x = toplevel->priv->animation_end_x;
+	y = toplevel->priv->animation_end_y;
+	x += panel_multiscreen_x (screen, toplevel->priv->monitor);
+	x += panel_multiscreen_y (screen, toplevel->priv->monitor);
+	if (toplevel->priv->animation_end_width != -1)
+		width = toplevel->priv->animation_end_width;
+	else
+		width = toplevel->priv->geometry.width;
+	if (toplevel->priv->animation_end_height != -1)
+		height = toplevel->priv->animation_end_height;
+	else
 		height = toplevel->priv->geometry.height;
-	}
 
 	orientation = toplevel->priv->orientation;
 
@@ -1827,7 +1825,7 @@ panel_toplevel_update_auto_hide_position (PanelToplevel *toplevel,
 	height = toplevel->priv->original_height;
 	snap_tolerance = toplevel->priv->snap_tolerance;
 
-	if (toplevel->priv->initial_animation_done) {
+	if (toplevel->priv->initial_animation_started) {
 		auto_hide_size = panel_toplevel_get_effective_auto_hide_size (toplevel);
 	} else {
 		/* when loading, we animate from outside the screen */
@@ -2029,6 +2027,7 @@ panel_toplevel_update_animating_position (PanelToplevel *toplevel)
 	if (toplevel->priv->geometry.x - monitor_offset_x == toplevel->priv->animation_end_x &&
 	    toplevel->priv->geometry.y - monitor_offset_y == toplevel->priv->animation_end_y) {
 		toplevel->priv->animating = FALSE;
+		toplevel->priv->initial_animation_done = TRUE;
 
 		if (toplevel->priv->attached && panel_toplevel_get_is_hidden (toplevel))
 			gtk_widget_unmap (GTK_WIDGET (toplevel));
@@ -2499,7 +2498,12 @@ panel_toplevel_update_geometry (PanelToplevel  *toplevel,
 	panel_toplevel_update_size (toplevel, requisition);
 	panel_toplevel_update_position (toplevel);
 
-	panel_toplevel_update_struts (toplevel, FALSE);
+	panel_toplevel_update_struts (toplevel);
+
+	if (toplevel->priv->animating) {
+		return;
+	}
+
 	if (toplevel->priv->state == PANEL_STATE_NORMAL ||
 	    toplevel->priv->state == PANEL_STATE_AUTO_HIDDEN) {
 		panel_struts_update_toplevel_geometry (toplevel,
@@ -2898,6 +2902,7 @@ static void
 panel_toplevel_initially_hide (PanelToplevel *toplevel)
 {
 	if (!toplevel->priv->attached) {
+		toplevel->priv->initial_animation_started = FALSE;
 		toplevel->priv->initial_animation_done = FALSE;
 
 		/* We start the panel off hidden until all the
@@ -2907,9 +2912,11 @@ panel_toplevel_initially_hide (PanelToplevel *toplevel)
 		toplevel->priv->state = PANEL_STATE_AUTO_HIDDEN;
 		gtk_widget_queue_resize (GTK_WIDGET (toplevel));
 
-		panel_toplevel_update_struts (toplevel, FALSE);
-	} else
+		panel_toplevel_update_struts (toplevel);
+	} else {
+		toplevel->priv->initial_animation_started = TRUE;
 		toplevel->priv->initial_animation_done = TRUE;
+        }
 
 }
 
@@ -3298,6 +3305,7 @@ panel_toplevel_animation_timeout (PanelToplevel *toplevel)
 		toplevel->priv->animation_end_time.tv_sec    = 0xdead;
 		toplevel->priv->animation_end_time.tv_usec   = 0xdead;
 		toplevel->priv->animation_timeout            = 0;
+		toplevel->priv->initial_animation_started    = TRUE;
 		toplevel->priv->initial_animation_done       = TRUE;
 	}
 
@@ -3343,6 +3351,9 @@ panel_toplevel_calculate_animation_end_geometry (PanelToplevel *toplevel)
 	GdkScreen *screen;
 	int        monitor_width, monitor_height;
 
+        if (toplevel->priv->animating)
+                return;
+
 	toplevel->priv->animation_end_x      = toplevel->priv->x;
 	toplevel->priv->animation_end_y      = toplevel->priv->y;
 	toplevel->priv->animation_end_width  = -1;
@@ -3395,13 +3406,12 @@ panel_toplevel_start_animation (PanelToplevel *toplevel)
 
 	toplevel->priv->animating = TRUE;
 
-	panel_toplevel_update_struts (toplevel, TRUE);
 	panel_struts_update_toplevel_geometry (toplevel,
 					       &toplevel->priv->animation_end_x,
 					       &toplevel->priv->animation_end_y,
 					       &toplevel->priv->animation_end_width,
 					       &toplevel->priv->animation_end_height);
-	panel_toplevel_update_struts (toplevel, FALSE);
+	panel_toplevel_update_struts (toplevel);
 
 	gdk_window_get_origin (GTK_WIDGET (toplevel)->window, &cur_x, &cur_y);
 
@@ -3571,16 +3581,18 @@ panel_toplevel_auto_unhide_timeout_handler (PanelToplevel *toplevel)
 	if (toplevel->priv->animating)
 		return TRUE;
 
-	if (!toplevel->priv->animate)
+	if (!toplevel->priv->animate) {
+		toplevel->priv->initial_animation_started = TRUE;
 		toplevel->priv->initial_animation_done = TRUE;
+        }
 
 	/* initial animation for auto-hidden panels: we need to unhide and hide
 	 * again to get at the right size */
-	if (!toplevel->priv->initial_animation_done &&
+	if (!toplevel->priv->initial_animation_started &&
 	    toplevel->priv->auto_hide) {
 		toplevel->priv->unhide_timeout = 0;
 		panel_toplevel_unhide (toplevel);
-		toplevel->priv->initial_animation_done = TRUE;
+		toplevel->priv->initial_animation_started = TRUE;
 		panel_toplevel_hide (toplevel, TRUE, -1);
 		return FALSE;
 	}
@@ -3656,7 +3668,7 @@ panel_toplevel_queue_auto_unhide (PanelToplevel *toplevel)
 void
 panel_toplevel_queue_initial_unhide (PanelToplevel *toplevel)
 {
-	if (toplevel->priv->initial_animation_done)
+	if (toplevel->priv->initial_animation_started)
 		return;
        /* Give the applets a second or so to frob after registering */
 	toplevel->priv->unhide_timeout =
@@ -4505,8 +4517,9 @@ panel_toplevel_init (PanelToplevel *toplevel)
 	toplevel->priv->position_centered = FALSE;
 	toplevel->priv->attached          = FALSE;
 	toplevel->priv->attach_hidden     = FALSE;
-	toplevel->priv->updated_geometry_initial = FALSE;
-	toplevel->priv->initial_animation_done   = FALSE;
+	toplevel->priv->updated_geometry_initial  = FALSE;
+	toplevel->priv->initial_animation_started = FALSE;
+	toplevel->priv->initial_animation_done    = FALSE;
 
 	gtk_widget_add_events (GTK_WIDGET (toplevel),
 			       GDK_BUTTON_PRESS_MASK |
@@ -4809,7 +4822,7 @@ panel_toplevel_set_auto_hide_size (PanelToplevel *toplevel,
 	toplevel->priv->auto_hide_size = auto_hide_size;
 
 	if (toplevel->priv->state == PANEL_STATE_AUTO_HIDDEN) {
-		if (panel_toplevel_update_struts (toplevel, FALSE)) {
+		if (panel_toplevel_update_struts (toplevel)) {
 			if (toplevel->priv->animate) {
 				panel_toplevel_unhide (toplevel);
 				panel_toplevel_hide (toplevel, TRUE, -1);
@@ -4985,7 +4998,7 @@ panel_toplevel_set_auto_hide (PanelToplevel *toplevel,
 	else
 		panel_toplevel_queue_auto_unhide (toplevel);
 
-	if (panel_toplevel_update_struts (toplevel, FALSE))
+	if (panel_toplevel_update_struts (toplevel))
 		gtk_widget_queue_resize (GTK_WIDGET (toplevel));
 
 	g_object_notify (G_OBJECT (toplevel), "auto-hide");

commit 2184c0fc4aa8fea0ffebe1192164125e24107178
Author: Ray Strode <rstrode@redhat.com>
Date:   Mon Nov 3 17:12:04 2008 -0500

    Set up struts initially when realizing window

diff --git a/gnome-panel/panel-toplevel.c b/gnome-panel/panel-toplevel.c
index bef6a02..96f564c 100644
--- a/gnome-panel/panel-toplevel.c
+++ b/gnome-panel/panel-toplevel.c
@@ -2939,6 +2939,7 @@ panel_toplevel_realize (GtkWidget *widget)
 
 	panel_toplevel_initially_hide (toplevel);
 
+	panel_toplevel_update_struts (toplevel);
 	panel_toplevel_move_resize_window (toplevel, TRUE, TRUE);
 }
 

commit 835cea12efb407b2c9181d33e442317cc1a16904
Author: Ray Strode <rstrode@redhat.com>
Date:   Mon Nov 3 17:13:32 2008 -0500

    Set up initial animation to correct position
    
    The initial animation for autohidden panels, is
    the auto hide size, not the normal size.  So,
    detect that case and only slide to the autohide size.

diff --git a/gnome-panel/panel-toplevel.c b/gnome-panel/panel-toplevel.c
index 96f564c..0a71ba0 100644
--- a/gnome-panel/panel-toplevel.c
+++ b/gnome-panel/panel-toplevel.c
@@ -3412,7 +3412,30 @@ panel_toplevel_start_animation (PanelToplevel *toplevel)
 					       &toplevel->priv->animation_end_y,
 					       &toplevel->priv->animation_end_width,
 					       &toplevel->priv->animation_end_height);
-	panel_toplevel_update_struts (toplevel);
+
+	/* If we're in the initial animation and we're autohidden, we only want
+	 * to animate to the autohidden height
+	 */
+	if (toplevel->priv->initial_animation_started && !toplevel->priv->initial_animation_done && toplevel->priv->state == PANEL_STATE_AUTO_HIDDEN) {
+	switch (toplevel->priv->orientation) {
+	case PANEL_ORIENTATION_TOP:
+		toplevel->priv->animation_end_y -= toplevel->priv->geometry.height;
+		toplevel->priv->animation_end_y += panel_toplevel_get_effective_auto_hide_size (toplevel);
+		break;
+	case PANEL_ORIENTATION_BOTTOM:
+		toplevel->priv->animation_end_y += toplevel->priv->geometry.height;
+		toplevel->priv->animation_end_y -= panel_toplevel_get_effective_auto_hide_size (toplevel);
+		break;
+	case PANEL_ORIENTATION_LEFT:
+		toplevel->priv->animation_end_x -= toplevel->priv->geometry.width;
+		toplevel->priv->animation_end_x += panel_toplevel_get_effective_auto_hide_size (toplevel);
+		break;
+	case PANEL_ORIENTATION_RIGHT:
+		toplevel->priv->animation_end_x += toplevel->priv->geometry.width;
+		toplevel->priv->animation_end_x -= panel_toplevel_get_effective_auto_hide_size (toplevel);
+		break;
+		}
+	}
 
 	gdk_window_get_origin (GTK_WIDGET (toplevel)->window, &cur_x, &cur_y);
 
