Index: bacon-video-widget-xine.c
===================================================================
RCS file: /cvs/gnome/totem/src/bacon-video-widget-xine.c,v
retrieving revision 1.173
diff -u -r1.173 bacon-video-widget-xine.c
--- bacon-video-widget-xine.c	13 Mar 2005 23:41:10 -0000	1.173
+++ bacon-video-widget-xine.c	20 Mar 2005 10:36:43 -0000
@@ -51,8 +51,8 @@
 #include "video-utils.h"
 #include "bacon-resize.h"
 
-#define DEFAULT_HEIGHT 315
-#define DEFAULT_WIDTH 420
+#define DEFAULT_HEIGHT 180
+#define DEFAULT_WIDTH 240
 #define CONFIG_FILE ".gnome2"G_DIR_SEPARATOR_S"totem_config"
 
 /* Signals */
@@ -236,6 +236,8 @@
 		GdkEventMotion *event);
 static gboolean bacon_video_widget_button_press (GtkWidget *widget,
 		GdkEventButton *event);
+static void bacon_video_widget_map (GtkWidget *widget);
+static void bacon_video_widget_unmap (GtkWidget *widget);
 
 static void bacon_video_widget_size_request (GtkWidget *widget,
 		GtkRequisition *requisition);
@@ -277,6 +279,8 @@
 	widget_class->expose_event = bacon_video_widget_expose;
 	widget_class->motion_notify_event = bacon_video_widget_motion_notify;
 	widget_class->button_press_event = bacon_video_widget_button_press;
+	widget_class->map = bacon_video_widget_map;
+	widget_class->unmap = bacon_video_widget_unmap;
 
 	/* GObject */
 	object_class->set_property = bacon_video_widget_set_property;
@@ -1698,13 +1702,47 @@
 }
 
 static void
+bacon_video_widget_map (GtkWidget *widget)
+{
+	BaconVideoWidget *bvw = (BaconVideoWidget *) widget;
+
+	GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
+
+	gdk_window_show (bvw->priv->video_window);
+	gtk_widget_set_size_request (widget, DEFAULT_WIDTH, DEFAULT_HEIGHT);
+
+	if (GTK_WIDGET_CLASS (parent_class)->map != NULL)
+		(* GTK_WIDGET_CLASS (parent_class)->map) (widget);
+}
+
+static void
+bacon_video_widget_unmap (GtkWidget *widget)
+{
+	BaconVideoWidget *bvw = (BaconVideoWidget *) widget;
+
+	GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);
+
+	gdk_window_hide (bvw->priv->video_window);
+	bacon_video_widget_set_scale_ratio (bvw, 0);
+
+	if (GTK_WIDGET_CLASS (parent_class)->unmap != NULL)
+		(* GTK_WIDGET_CLASS (parent_class)->unmap) (widget);
+}
+
+static void
 bacon_video_widget_size_request (GtkWidget *widget, GtkRequisition *requisition)
 {
 	g_return_if_fail(widget != NULL);
 	g_return_if_fail(BACON_IS_VIDEO_WIDGET(widget));
 
-	requisition->width = 240;
-	requisition->height = 180;
+	if (GTK_WIDGET_MAPPED (widget))
+	{
+		requisition->width = DEFAULT_WIDTH;
+		requisition->height = DEFAULT_HEIGHT;
+	} else {
+		requisition->width = 0;
+		requisition->height = 0;
+	}
 }
 
 static void
@@ -2651,6 +2689,16 @@
 	return TRUE;
 }
 
+gboolean
+bacon_video_widget_get_show_visuals (BaconVideoWidget *bvw)
+{
+	g_return_val_if_fail (bvw != NULL, FALSE);
+	g_return_val_if_fail (BACON_IS_VIDEO_WIDGET (bvw), FALSE);
+	g_return_val_if_fail (bvw->priv->xine != NULL, FALSE);
+
+	return bvw->priv->show_vfx;
+}
+
 GList *
 bacon_video_widget_get_visuals_list (BaconVideoWidget *bvw)
 {
@@ -3020,10 +3068,16 @@
 
 	/* Calculate the new size of the window, depending on the size of the
 	 * video widget, and the new size of the video */
-	new_w = win_w - widget->allocation.width +
-		bvw->priv->video_width * ratio;
-	new_h = win_h - widget->allocation.height +
-		bvw->priv->video_height * ratio;
+	if (GTK_WIDGET_MAPPED (widget))
+	{
+		new_w = win_w - widget->allocation.width +
+			bvw->priv->video_width * ratio;
+		new_h = win_h - widget->allocation.height +
+			bvw->priv->video_height * ratio;
+	} else {
+		new_w = win_w;
+		new_h = win_h - widget->allocation.height;
+	}
 
 	/* Change the minimum size of the widget
 	 * but only if we're getting a smaller window */
Index: bacon-video-widget.h
===================================================================
RCS file: /cvs/gnome/totem/src/bacon-video-widget.h,v
retrieving revision 1.58
diff -u -r1.58 bacon-video-widget.h
--- bacon-video-widget.h	13 Mar 2005 23:56:32 -0000	1.58
+++ bacon-video-widget.h	20 Mar 2005 10:36:43 -0000
@@ -219,6 +219,7 @@
 
 gboolean bacon_video_widget_set_show_visuals	  (BaconVideoWidget *bvw,
 						   gboolean show_visuals);
+gboolean bacon_video_widget_get_show_visuals	  (BaconVideoWidget *bvw);
 GList *bacon_video_widget_get_visuals_list	  (BaconVideoWidget *bvw);
 gboolean bacon_video_widget_set_visuals		  (BaconVideoWidget *bvw,
 						   const char *name);
Index: bvw-test.c
===================================================================
RCS file: /cvs/gnome/totem/src/bvw-test.c,v
retrieving revision 1.6
diff -u -r1.6 bvw-test.c
--- bvw-test.c	23 Dec 2004 23:58:29 -0000	1.6
+++ bvw-test.c	20 Mar 2005 10:36:43 -0000
@@ -6,7 +6,9 @@
 
 GtkWidget *win;
 GtkWidget *xine;
+GtkWidget *win2, *button;
 char *mrl, *argument;
+gboolean shown = TRUE;
 
 static void test_xine_set_mrl(char *path)
 {
@@ -25,6 +27,19 @@
 	bacon_video_widget_play (BACON_VIDEO_WIDGET (xine), NULL);
 }
 
+static void
+button_pressed (GtkButton *button, gpointer data)
+{
+	shown = !shown;
+	if (shown == FALSE) {
+		g_message ("hiding");
+		gtk_widget_hide (xine);
+	} else {
+		g_message ("showing");
+		gtk_widget_show (xine);
+	}
+}
+
 int main(int argc, char *argv[])
 {
 	guint32 height = 500;
@@ -56,9 +71,18 @@
 	gtk_widget_show(win);
 	gtk_widget_show(xine);
 
+	win2 = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+	button = gtk_button_new_with_label ("hide/show");
+	gtk_container_add(GTK_CONTAINER(win2), button);
+	g_signal_connect (G_OBJECT (button), "clicked",
+			G_CALLBACK (button_pressed), NULL);
+	gtk_widget_show_all (win2);
+
 	mrl = NULL;
 	test_xine_set_mrl(argv[1] ? argv[1] : LOGO_PATH);
 	argument = g_strdup (argv[1] ? argv[1] : LOGO_PATH);
+	bacon_video_widget_set_volume (BACON_VIDEO_WIDGET (xine), 5);
+	bacon_video_widget_set_show_visuals (BACON_VIDEO_WIDGET (xine), TRUE);
 	bacon_video_widget_play (BACON_VIDEO_WIDGET (xine), NULL);
 	gtk_main();
 
Index: totem.c
===================================================================
RCS file: /cvs/gnome/totem/src/totem.c,v
retrieving revision 1.415
diff -u -r1.415 totem.c
--- totem.c	14 Mar 2005 14:42:35 -0000	1.415
+++ totem.c	20 Mar 2005 10:36:46 -0000
@@ -1132,8 +1132,20 @@
 {
         char *name = NULL;
 	gboolean custom;
+	GValue value = { 0, };
 
-        bacon_video_widget_properties_update
+	bacon_video_widget_get_metadata (bvw, BVW_INFO_HAS_VIDEO, &value);
+	if (g_value_get_boolean (&value) == FALSE)
+	{
+		if (bacon_video_widget_get_show_visuals (bvw) == FALSE)
+		{
+			gtk_widget_hide (GTK_WIDGET (bvw));
+		}
+	} else {
+		gtk_widget_show (GTK_WIDGET (bvw));
+	}
+
+	bacon_video_widget_properties_update
 		(BACON_VIDEO_WIDGET_PROPERTIES (totem->properties),
 		 totem->bvw, FALSE);
 
