[Xfce4-commits] <ristretto:master> Fix bug #7867
Stephan Arts
noreply at xfce.org
Mon Oct 17 14:08:03 CEST 2011
Updating branch refs/heads/master
to 23c1c7206a9b423d8f53c7ca2aa8b980131bf894 (commit)
from cc347c6ea03cf040229b5ca606d9b5eb732a9437 (commit)
commit 23c1c7206a9b423d8f53c7ca2aa8b980131bf894
Author: Stephan Arts <stephan at xfce.org>
Date: Mon Oct 17 13:47:59 2011 +0200
Fix bug #7867
Move update of the adjustment page_size to the queued_repaint
callback function. This way the adjustments do not get their
updates before the _upper limit is changed too.
This fixes a problem where the image-viewer is updated too often,
sometimes indefinately until the widget-size is changed again.
src/image_viewer.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/image_viewer.c b/src/image_viewer.c
index 7bebfbd..e1caf64 100644
--- a/src/image_viewer.c
+++ b/src/image_viewer.c
@@ -405,8 +405,6 @@ rstto_image_viewer_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
allocation->width - border_width * 2,
allocation->height - border_width * 2);
- gtk_adjustment_set_page_size (viewer->hadjustment, ((gdouble)allocation->width));
- gtk_adjustment_set_page_size (viewer->vadjustment, ((gdouble)allocation->height));
}
/**
@@ -1486,6 +1484,7 @@ cb_rstto_image_viewer_update_pixbuf (RsttoImageViewer *viewer)
static gboolean
cb_rstto_image_viewer_queued_repaint (RsttoImageViewer *viewer)
{
+ GtkWidget *widget = GTK_WIDGET(viewer);
gint width, height;
gdouble v_scale, h_scale;
GtkAdjustment *hadjustment, *vadjustment;
@@ -1794,6 +1793,9 @@ cb_rstto_image_viewer_queued_repaint (RsttoImageViewer *viewer)
gtk_adjustment_set_upper (viewer->vadjustment, 0);
}
+ gtk_adjustment_set_page_size (viewer->hadjustment, (gdouble)(widget->allocation.width));
+ gtk_adjustment_set_page_size (viewer->vadjustment, (gdouble)(widget->allocation.height));
+
g_object_thaw_notify(G_OBJECT(viewer->hadjustment));
g_object_thaw_notify(G_OBJECT(viewer->vadjustment));
More information about the Xfce4-commits
mailing list