X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=shell%2Fev-view.c;h=1659302e21daab775fc88eb19a4b56fcfc475b00;hb=96899f8a7253f3ade7f116a89344595d5eef817a;hp=1685aee823eb8c8070111dcda836083913ed187e;hpb=5f7d46028f2345a1e4d1690fc8d2228fc1a9c506;p=evince.git diff --git a/shell/ev-view.c b/shell/ev-view.c index 1685aee8..1659302e 100644 --- a/shell/ev-view.c +++ b/shell/ev-view.c @@ -4211,14 +4211,15 @@ ev_view_init (EvView *view) static void ev_view_change_page (EvView *view, - gint new_page) + gint new_page, + gboolean start_transition) { gint x, y; view->current_page = new_page; view->pending_scroll = SCROLL_TO_PAGE_POSITION; - if (view->presentation) + if (view->presentation && start_transition) ev_view_presentation_transition_start (view); gtk_widget_get_pointer (GTK_WIDGET (view), &x, &y); @@ -4233,7 +4234,24 @@ ev_view_transition_animation_finish (EvTransitionAnimation *animation, { g_object_unref (view->animation); view->animation = NULL; - ev_view_change_page (view, view->current_page); + ev_view_change_page (view, view->current_page, TRUE); +} + +/** + * ev_view_transition_animation_cancel: + * @animation: Animation to finish + * @view: An EvView + * + * Does almost the same as cancel, but without scheduling the transition. + */ + +static void +ev_view_transition_animation_cancel (EvTransitionAnimation *animation, + EvView *view) +{ + g_object_unref (view->animation); + view->animation = NULL; + ev_view_change_page (view, view->current_page, FALSE); } static void @@ -4296,7 +4314,7 @@ page_changed_cb (EvPageCache *page_cache, if (view->presentation) ev_view_presentation_animation_start (view, new_page); - ev_view_change_page (view, new_page); + ev_view_change_page (view, new_page, TRUE); } else { gtk_widget_queue_draw (GTK_WIDGET (view)); } @@ -4666,7 +4684,7 @@ ev_view_set_presentation (EvView *view, if (view->animation) { /* stop any running animation */ - ev_view_transition_animation_finish (view->animation, view); + ev_view_transition_animation_cancel (view->animation, view); } } @@ -5390,6 +5408,7 @@ merge_selection_region (EvView *view, /* Update the selection */ old_list = ev_pixbuf_cache_get_selection_list (view->pixbuf_cache); g_list_foreach (view->selection_info.selections, (GFunc)selection_free, NULL); + g_list_free (view->selection_info.selections); view->selection_info.selections = new_list; ev_pixbuf_cache_set_selection_list (view->pixbuf_cache, new_list); g_object_notify (G_OBJECT (view), "has-selection"); @@ -5498,6 +5517,7 @@ merge_selection_region (EvView *view, /* Free the old list, now that we're done with it. */ g_list_foreach (old_list, (GFunc) selection_free, NULL); + g_list_free (old_list); } static void @@ -5529,6 +5549,7 @@ static void clear_selection (EvView *view) { g_list_foreach (view->selection_info.selections, (GFunc)selection_free, NULL); + g_list_free (view->selection_info.selections); view->selection_info.selections = NULL; view->selection_info.in_selection = FALSE; if (view->pixbuf_cache) @@ -5821,8 +5842,7 @@ ev_view_next_page (EvView *view) } if (view->animation) { - ev_view_transition_animation_finish (view->animation, view); - return TRUE; + ev_view_transition_animation_cancel (view->animation, view); } ev_view_presentation_transition_stop (view); @@ -5875,8 +5895,7 @@ ev_view_previous_page (EvView *view) } if (view->animation) { - ev_view_transition_animation_finish (view->animation, view); - return TRUE; + ev_view_transition_animation_cancel (view->animation, view); } ev_view_reset_presentation_state (view);