From 2c8f2e225edad376a726a8efe86923c20c6c2c01 Mon Sep 17 00:00:00 2001 From: "Nickolay V. Shmyrev" Date: Fri, 20 May 2005 09:22:53 +0000 Subject: [PATCH] Fix flickering on resizing --- ChangeLog | 6 ++++++ shell/ev-view.c | 12 +++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6188d1e8..fe688aea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Fri May 20 02:00:03 2005 Nickolay V. Shmyrev + + * shell/ev-view.c: Use gdk_widget_queue_draw to remove + flickering on resize but still use gdk_window_scroll on + scrolling + Fri May 20 01:46:57 2005 Jonathan Blandford * shell/ev-view.c: Patch from Nickolay Shmyrev to fix the -p diff --git a/shell/ev-view.c b/shell/ev-view.c index e9cbee5e..d9dddaf2 100644 --- a/shell/ev-view.c +++ b/shell/ev-view.c @@ -149,6 +149,7 @@ struct _EvView { EvSizingMode sizing_mode; PendingScroll pending_scroll; + gboolean pending_resize; }; struct _EvViewClass { @@ -376,9 +377,12 @@ view_update_adjustments (EvView *view) } else { view->scroll_y = 0; } - - // gtk_widget_queue_draw (GTK_WIDGET (view)); - gdk_window_scroll (GTK_WIDGET (view)->window, dx, dy); + + + if (view->pending_resize) + gtk_widget_queue_draw (GTK_WIDGET (view)); + else + gdk_window_scroll (GTK_WIDGET (view)->window, dx, dy); if (view->document) @@ -1226,6 +1230,7 @@ ev_view_size_allocate (GtkWidget *widget, view_set_adjustment_values (view, GTK_ORIENTATION_VERTICAL); view->pending_scroll = SCROLL_TO_KEEP_POSITION; + view->pending_resize = FALSE; if (view->document) view_update_range_and_current_page (view); @@ -1995,6 +2000,7 @@ ev_view_set_zoom (EvView *view, if (ABS (view->scale - scale) < EPSILON) return; view->scale = scale; + view->pending_resize = TRUE; gtk_widget_queue_resize (GTK_WIDGET (view)); } -- 2.43.5