[gthumb] slideshow: image not always maximized when using clutter



commit e22bfe5e6e42e41241a1852bdf75773324e9f65a
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sat Sep 11 12:08:45 2010 +0200

    slideshow: image not always maximized when using clutter
    
    explictly set the window size to the screen size

 extensions/slideshow/actions.c       |    4 +++-
 extensions/slideshow/gth-slideshow.c |   17 +++++++++++++----
 2 files changed, 16 insertions(+), 5 deletions(-)
---
diff --git a/extensions/slideshow/actions.c b/extensions/slideshow/actions.c
index 17dcc97..6258860 100644
--- a/extensions/slideshow/actions.c
+++ b/extensions/slideshow/actions.c
@@ -41,6 +41,7 @@ gth_browser_activate_action_view_slideshow (GtkAction  *action,
 	GthFileData  *location;
 	char         *transition_id;
 	GList        *transitions = NULL;
+	GdkScreen    *screen;
 
 	items = gth_file_selection_get_selected (GTH_FILE_SELECTION (gth_browser_get_file_list_view (browser)));
 	if ((items == NULL) || (items->next == NULL))
@@ -122,8 +123,9 @@ gth_browser_activate_action_view_slideshow (GtkAction  *action,
 	}
 	gth_slideshow_set_transitions (GTH_SLIDESHOW (slideshow), transitions);
 
+	screen = gtk_widget_get_screen (slideshow);
+	gtk_window_set_default_size (GTK_WINDOW (slideshow), gdk_screen_get_width (screen), gdk_screen_get_height (screen));
 	gtk_window_fullscreen (GTK_WINDOW (slideshow));
-	/*gtk_window_set_default_size (GTK_WINDOW (slideshow), 700, 700);*/
 	gtk_window_present (GTK_WINDOW (slideshow));
 
 	_g_object_list_unref (transitions);
diff --git a/extensions/slideshow/gth-slideshow.c b/extensions/slideshow/gth-slideshow.c
index e8bbc8d..667b183 100644
--- a/extensions/slideshow/gth-slideshow.c
+++ b/extensions/slideshow/gth-slideshow.c
@@ -997,11 +997,8 @@ stage_input_cb (ClutterStage *stage,
 
 
 static void
-gth_slideshow_size_allocate_cb (GtkWidget     *widget,
-				GtkAllocation *allocation,
-				gpointer       user_data)
+adapt_image_size_to_stage_size (GthSlideshow *self)
 {
-	GthSlideshow   *self = user_data;
 	gfloat          stage_w, stage_h;
 	GdkPixbuf      *image;
 	int             pixbuf_w, pixbuf_h;
@@ -1061,6 +1058,15 @@ gth_slideshow_size_allocate_cb (GtkWidget     *widget,
 
 
 static void
+gth_slideshow_size_allocate_cb (GtkWidget     *widget,
+				GtkAllocation *allocation,
+				gpointer       user_data)
+{
+	adapt_image_size_to_stage_size (GTH_SLIDESHOW (user_data));
+}
+
+
+static void
 clutter_projector_construct (GthSlideshow *self)
 {
 	GtkWidget    *embed;
@@ -1097,6 +1103,9 @@ clutter_projector_construct (GthSlideshow *self)
 	clutter_container_add_actor (CLUTTER_CONTAINER (self->stage), self->priv->paused_actor);
 
 	g_signal_connect (self, "size-allocate", G_CALLBACK (gth_slideshow_size_allocate_cb), self);
+
+	gtk_widget_show (embed);
+	gtk_container_add (GTK_CONTAINER (self), embed);
 }
 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]