X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=shell%2Fev-sidebar-thumbnails.c;h=2850514bc6345160c9d4764030c70b76864f730b;hb=0be3be0d4166be324d628802772e99cacd336f11;hp=7fe62f16c065ca3c280d3fbe44fcefd879b04e9d;hpb=e71d27db284ccf431167816167bf72f1e23c334d;p=evince.git diff --git a/shell/ev-sidebar-thumbnails.c b/shell/ev-sidebar-thumbnails.c index 7fe62f16..2850514b 100644 --- a/shell/ev-sidebar-thumbnails.c +++ b/shell/ev-sidebar-thumbnails.c @@ -27,16 +27,17 @@ #endif #include -#include + #include +#include -#include "ev-sidebar-page.h" -#include "ev-sidebar-thumbnails.h" -#include "ev-document-thumbnails.h" #include "ev-document-misc.h" +#include "ev-document-thumbnails.h" #include "ev-job-scheduler.h" -#include "ev-window.h" +#include "ev-sidebar-page.h" +#include "ev-sidebar-thumbnails.h" #include "ev-utils.h" +#include "ev-window.h" #define THUMBNAIL_WIDTH 100 @@ -325,18 +326,21 @@ adjustment_changed_cb (EvSidebarThumbnails *sidebar_thumbnails) /* Widget is not currently visible */ if (!GTK_WIDGET_MAPPED (sidebar_thumbnails)) return; + + if (priv->vadjustment->page_size == 0) + return; if (priv->tree_view) { if (! GTK_WIDGET_REALIZED (priv->tree_view)) return; #if GTK_CHECK_VERSION (2, 11, 3) - gtk_tree_view_convert_widget_to_bin_window_coords (GTK_TREE_VIEW (priv->tree_view), - 0, (int) priv->vadjustment->value, - NULL, &wy1); - gtk_tree_view_convert_widget_to_bin_window_coords (GTK_TREE_VIEW (priv->tree_view), - 0, (int) (priv->vadjustment->value + priv->vadjustment->page_size), - NULL, &wy2); + gtk_tree_view_convert_tree_to_bin_window_coords (GTK_TREE_VIEW (priv->tree_view), + 0, (int) priv->vadjustment->value, + NULL, &wy1); + gtk_tree_view_convert_tree_to_bin_window_coords (GTK_TREE_VIEW (priv->tree_view), + 0, (int) (priv->vadjustment->value + priv->vadjustment->page_size), + NULL, &wy2); #else gtk_tree_view_tree_to_widget_coords (GTK_TREE_VIEW (priv->tree_view), 0, (int) priv->vadjustment->value, @@ -345,7 +349,7 @@ adjustment_changed_cb (EvSidebarThumbnails *sidebar_thumbnails) 0, (int) (priv->vadjustment->value + priv->vadjustment->page_size), NULL, &wy2); #endif /* GTK_CHECK_VERSION (2, 11, 3) */ - + gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (priv->tree_view), 1, wy1 + 1, &path, NULL, NULL, NULL);