Index: ChangeLog =================================================================== RCS file: /cvs/gnome/evince/ChangeLog,v retrieving revision 1.863 diff -u -u -r1.863 ChangeLog --- ChangeLog 14 Aug 2006 23:12:28 -0000 1.863 +++ ChangeLog 15 Aug 2006 15:14:17 -0000 @@ -1,3 +1,10 @@ +2006-08-14 Carlos Garcia Campos + + * shell/ev-sidebar-thumbnails.c: + + Do not render thumbnails unless thumbnails page is active in the + sidebar. + 2006-08-14 Christian Persch * shell/ev-properties-dialog.c: Index: shell/ev-sidebar-thumbnails.c =================================================================== RCS file: /cvs/gnome/evince/shell/ev-sidebar-thumbnails.c,v retrieving revision 1.43 diff -u -u -r1.43 ev-sidebar-thumbnails.c --- shell/ev-sidebar-thumbnails.c 29 May 2006 16:26:31 -0000 1.43 +++ shell/ev-sidebar-thumbnails.c 15 Aug 2006 15:14:18 -0000 @@ -59,6 +59,8 @@ int rotation; + gboolean visible; + /* Visible pages */ gint start_page, end_page; }; @@ -85,6 +87,7 @@ static const gchar* ev_sidebar_thumbnails_get_label (EvSidebarPage *sidebar_page); static void thumbnail_job_completed_callback (EvJobThumbnail *job, EvSidebarThumbnails *sidebar_thumbnails); +static void adjustment_changed_cb (EvSidebarThumbnails *sidebar_thumbnails); G_DEFINE_TYPE_EXTENDED (EvSidebarThumbnails, ev_sidebar_thumbnails, @@ -124,8 +127,7 @@ { EvSidebarThumbnails *sidebar = EV_SIDEBAR_THUMBNAILS (object); - switch (prop_id) - { + switch (prop_id) { case PROP_WIDGET: if (sidebar->priv->tree_view) g_value_set_object (value, sidebar->priv->tree_view); @@ -139,16 +141,46 @@ } static void +ev_sidebar_thumbnails_map (GtkWidget *widget) +{ + EvSidebarThumbnails *sidebar; + + sidebar = EV_SIDEBAR_THUMBNAILS (widget); + + sidebar->priv->visible = TRUE; + + GTK_WIDGET_CLASS (ev_sidebar_thumbnails_parent_class)->map (widget); + + adjustment_changed_cb (sidebar); +} + +static void +ev_sidebar_thumbnails_unmap (GtkWidget *widget) +{ + EvSidebarThumbnails *sidebar; + + sidebar = EV_SIDEBAR_THUMBNAILS (widget); + + sidebar->priv->visible = FALSE; + + GTK_WIDGET_CLASS (ev_sidebar_thumbnails_parent_class)->unmap (widget); +} + +static void ev_sidebar_thumbnails_class_init (EvSidebarThumbnailsClass *ev_sidebar_thumbnails_class) { GObjectClass *g_object_class; GtkObjectClass *gtk_object_class; + GtkWidgetClass *widget_class; g_object_class = G_OBJECT_CLASS (ev_sidebar_thumbnails_class); gtk_object_class = GTK_OBJECT_CLASS (ev_sidebar_thumbnails_class); + widget_class = GTK_WIDGET_CLASS (ev_sidebar_thumbnails_class); g_object_class->dispose = ev_sidebar_thumbnails_dispose; g_object_class->get_property = ev_sidebar_thumbnails_get_property; + widget_class->map = ev_sidebar_thumbnails_map; + widget_class->unmap = ev_sidebar_thumbnails_unmap; g_object_class_override_property (g_object_class, PROP_WIDGET, @@ -290,6 +322,10 @@ gint wy1; gint wy2; + /* Widget is not currently visible */ + if (!priv->visible) + return; + if (priv->tree_view) { if (! GTK_WIDGET_REALIZED (priv->tree_view)) return; @@ -449,6 +485,7 @@ GtkCellRenderer *renderer; priv = ev_sidebar_thumbnails->priv; + priv->visible = FALSE; priv->tree_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (priv->list_store)); selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->tree_view));