[gthumb] image viewer: do not update the visibility if not active



commit 9e140131e64ab15c83e74020cd19c363866659b5
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sun Dec 8 17:30:56 2013 +0100

    image viewer: do not update the visibility if not active

 extensions/image_viewer/gth-image-viewer-page.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/extensions/image_viewer/gth-image-viewer-page.c b/extensions/image_viewer/gth-image-viewer-page.c
index 74248ea..b709974 100644
--- a/extensions/image_viewer/gth-image-viewer-page.c
+++ b/extensions/image_viewer/gth-image-viewer-page.c
@@ -82,6 +82,7 @@ struct _GthImageViewerPagePrivate {
        guint              file_popup_merge_id;
        GthImageHistory   *history;
        GthFileData       *file_data;
+       gboolean           active;
        gboolean           image_changed;
        gboolean           loading_image;
        GFile             *last_loaded;
@@ -346,6 +347,9 @@ update_visibility_cb (gpointer user_data)
        GthImageViewerPage *self = user_data;
        gboolean            visible;
 
+       if (! self->priv->active)
+               return;
+
        if (self->priv->update_visibility_id != 0) {
                g_source_remove (self->priv->update_visibility_id);
                self->priv->update_visibility_id = 0;
@@ -782,6 +786,8 @@ gth_image_viewer_page_real_activate (GthViewerPage *base,
        self = (GthImageViewerPage*) base;
 
        self->priv->browser = browser;
+       self->priv->active = TRUE;
+
        g_action_map_add_action_entries (G_ACTION_MAP (browser),
                                         actions,
                                         G_N_ELEMENTS (actions),
@@ -921,6 +927,7 @@ gth_image_viewer_page_real_deactivate (GthViewerPage *base)
 
        g_object_unref (self->priv->preloader);
        self->priv->preloader = NULL;
+       self->priv->active = FALSE;
 
        gth_browser_set_viewer_widget (self->priv->browser, NULL);
 }
@@ -1606,6 +1613,7 @@ gth_image_viewer_page_init (GthImageViewerPage *self)
        self->priv->can_paste = FALSE;
        self->priv->update_quality_id = 0;
        self->priv->update_visibility_id = 0;
+       self->priv->active = FALSE;
 }
 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]