X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;ds=inline;f=shell%2Fev-sidebar-thumbnails.c;h=d6a8af51e8127248cde6077e3ac752792d02242b;hb=c6a200897a5fa91ed6585d1bc910234fdd8015a1;hp=325c1633ee147351ca95b2bf9b8b6286f47a7ebe;hpb=1d6150237848b4c1fede94ce23baa4fd8870fd93;p=evince.git diff --git a/shell/ev-sidebar-thumbnails.c b/shell/ev-sidebar-thumbnails.c index 325c1633..d6a8af51 100644 --- a/shell/ev-sidebar-thumbnails.c +++ b/shell/ev-sidebar-thumbnails.c @@ -354,14 +354,11 @@ adjustment_changed_cb (EvSidebarThumbnails *sidebar_thumbnails) return; } - if (path == NULL) - path = gtk_tree_path_new_first (); - if (path2 == NULL) - path2 = gtk_tree_path_new_from_indices (priv->n_pages, - -1); - update_visible_range (sidebar_thumbnails, - gtk_tree_path_get_indices (path)[0], - gtk_tree_path_get_indices (path2)[0]); + if (path && path2) { + update_visible_range (sidebar_thumbnails, + gtk_tree_path_get_indices (path)[0], + gtk_tree_path_get_indices (path2)[0]); + } gtk_tree_path_free (path); gtk_tree_path_free (path2); @@ -679,6 +676,9 @@ ev_sidebar_thumbnails_set_document (EvSidebarPage *sidebar_page, g_signal_connect (priv->page_cache, "page-changed", G_CALLBACK (page_changed_cb), sidebar_thumbnails); sidebar_thumbnails->priv->start_page = 0; sidebar_thumbnails->priv->end_page = 0; + page_changed_cb (priv->page_cache, + ev_page_cache_get_current_page (priv->page_cache), + sidebar_thumbnails); adjustment_changed_cb (sidebar_thumbnails); }