+2009-03-01 Carlos Garcia Campos <carlosgc@gnome.org>
+
+ * shell/ev-window.c: (ev_window_set_document),
+ (ev_window_reload_job_cb):
+
+ Do not lose page position when reloading. Fixes bug #573091.
+
2009-03-01 Carlos Garcia Campos <carlosgc@gnome.org>
* backend/pdf/ev-poppler.cc: (make_thumbnail_for_page),
g_signal_connect (ev_window->priv->page_cache, "history-changed",
G_CALLBACK (history_changed_cb), ev_window);
+ if (ev_window->priv->in_reload && ev_window->priv->dest) {
+ gint page;
+
+ /* Restart the current page */
+ page = CLAMP (ev_link_dest_get_page (ev_window->priv->dest),
+ 0,
+ ev_page_cache_get_n_pages (ev_window->priv->page_cache) - 1);
+ ev_page_cache_set_current_page (ev_window->priv->page_cache, page);
+ g_object_unref (ev_window->priv->dest);
+ ev_window->priv->dest = NULL;
+ }
+
if (ev_page_cache_get_n_pages (ev_window->priv->page_cache) > 0) {
ev_view_set_document (view, document);
} else {
EvWindow *ev_window)
{
GtkWidget *widget;
- gint page;
if (ev_job_is_failed (job)) {
ev_window_clear_reload_job (ev_window);
}
ev_window_set_document (ev_window, job->document);
-
- /* Restart the current page */
- page = CLAMP (ev_link_dest_get_page (ev_window->priv->dest),
- 0,
- ev_page_cache_get_n_pages (ev_window->priv->page_cache) - 1);
- ev_page_cache_set_current_page (ev_window->priv->page_cache, page);
- g_object_unref (ev_window->priv->dest);
- ev_window->priv->dest = NULL;
/* Restart the search after reloading */
widget = gtk_window_get_focus (GTK_WINDOW (ev_window));