[Xfce4-commits] <ristretto:master> Freeze the adjustments at the right time

Stephan Arts noreply at xfce.org
Thu Apr 19 20:30:03 CEST 2012


Updating branch refs/heads/master
         to 9687b2e9029bd32af8fa7887df3e3c3e12e2e0dd (commit)
       from 15e83042be137044c7dde05fe3c4445b1a4f831c (commit)

commit 9687b2e9029bd32af8fa7887df3e3c3e12e2e0dd
Author: Stephan Arts <stephan at xfce.org>
Date:   Thu Apr 19 20:27:42 2012 +0200

    Freeze the adjustments at the right time

 src/image_viewer.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/image_viewer.c b/src/image_viewer.c
index b199ddc..f22d5ce 100644
--- a/src/image_viewer.c
+++ b/src/image_viewer.c
@@ -919,23 +919,30 @@ correct_adjustments ( RsttoImageViewer *viewer )
     gdouble scale = viewer->priv->scale;
 
 
-    g_object_freeze_notify(G_OBJECT(viewer->hadjustment));
-    g_object_freeze_notify(G_OBJECT(viewer->vadjustment));
-
     /* Check if the image-size makes sense,
      * if not, set the upper limits to 0.0
      */
-    if ( (image_width < 1.0) || (image_height < 1.0) )
+    if ( (image_width <= 1.0) || (image_height <= 1.0) )
     {
+        gtk_adjustment_set_value (
+                viewer->hadjustment,
+                0.0 );
         gtk_adjustment_set_upper (
                 viewer->hadjustment,
                 0.0 );
+        gtk_adjustment_set_value (
+                viewer->vadjustment,
+                0.0 );
         gtk_adjustment_set_upper (
                 viewer->vadjustment,
                 0.0 );
         return;
     }
 
+    g_object_freeze_notify(G_OBJECT(viewer->hadjustment));
+    g_object_freeze_notify(G_OBJECT(viewer->vadjustment));
+
+
     switch (viewer->priv->orientation)
     {
         case RSTTO_IMAGE_ORIENT_NONE:


More information about the Xfce4-commits mailing list