File panel-toplevel-size-retain-while-change-orient.diff of Package gnome-panel-nld

--- gnome-panel/panel-toplevel.c
+++ gnome-panel/panel-toplevel.c
@@ -75,6 +75,7 @@
 	gboolean                expand;
 	PanelOrientation        orientation;
 	int                     size;
+	int			stretched_size;
 
 	/* relative to the monitor origin */
 	int                     x;
@@ -176,6 +177,10 @@
 	/* 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 check if mouse button is pressed */
+	guint			button_pressed : 1;
+	
 };
 
 enum {
@@ -2748,12 +2753,17 @@
 	/*If panel has stretched due to menubar on vertical panels, insert the values in gconf*/
         toplevel = PANEL_TOPLEVEL (container);
         if (toplevel->priv->orientation & PANEL_VERTICAL_MASK)
-	{
+	{	
+		toplevel->priv->stretched_size = 0;
                 width = toplevel->priv->original_width;
-                if (width >120 ) 
+                if (width >120) 
 		{
 			width = 120;
-                	panel_profile_set_toplevel_size (toplevel, width);
+			if (toplevel->priv->button_pressed)
+				toplevel->priv->stretched_size = width;
+        		else	
+				panel_profile_set_toplevel_size (toplevel, width);
+			
 		}
         }
 
@@ -2967,6 +2977,8 @@
 	g_return_val_if_fail (PANEL_IS_TOPLEVEL (widget), FALSE);
 
 	toplevel = PANEL_TOPLEVEL (widget);
+	
+	toplevel->priv->button_pressed = TRUE;
 
 	if (event->button != 1 && event->button != 2)
 		return FALSE;
@@ -2999,6 +3011,13 @@
 
 	toplevel = PANEL_TOPLEVEL (widget);
 
+	toplevel->priv->button_pressed = FALSE;
+
+	if (toplevel->priv->stretched_size && (toplevel->priv->orientation & PANEL_VERTICAL_MASK))
+	{	
+        	panel_profile_set_toplevel_size (toplevel, toplevel->priv->stretched_size);
+		toplevel->priv->stretched_size = 0;
+	}	
 	if (toplevel->priv->grab_op == PANEL_GRAB_OP_NONE)
 		return FALSE;