[eog: 1/2] EogWindow: Fix skipping images in slideshows on slow devices



commit 124d55344147f169608887275b3c61e91cda4ed2
Author: Stefan Richter <sealor users noreply github com>
Date:   Sun Sep 23 18:20:01 2018 +0200

    EogWindow: Fix skipping images in slideshows on slow devices
    
    If a slow device is used for accessing files in a slideshow some images
    get lost. This happens because sometimes images can not be loaded before
    the slideshow switches to the next slide.
    With this bugfix the timer does not tick in a fixed interval anymore.
    The timer starts after the current image is successfully loaded.
    
    Fixes #15

 src/eog-window.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/eog-window.c b/src/eog-window.c
index 4e913271..5be451f9 100644
--- a/src/eog-window.c
+++ b/src/eog-window.c
@@ -194,6 +194,7 @@ static void eog_job_progress_cb (EogJobLoad *job, float progress, gpointer data)
 static void eog_job_transform_cb (EogJobTransform *job, gpointer data);
 static void fullscreen_set_timeout (EogWindow *window);
 static void fullscreen_clear_timeout (EogWindow *window);
+static void slideshow_set_timeout (EogWindow *window);
 static void update_action_groups_state (EogWindow *window);
 static void eog_window_update_open_with_menu (EogWindow *window, EogImage *image);
 static void eog_window_list_store_image_added (GtkTreeModel *tree_model,
@@ -1017,6 +1018,10 @@ eog_window_display_image (EogWindow *window, EogImage *image)
                gtk_widget_show (info_bar);
                eog_window_set_message_area (window, info_bar);
        }
+
+       if (window->priv->mode == EOG_WINDOW_MODE_SLIDESHOW) {
+               slideshow_set_timeout (window);
+       }
 }
 
 static void
@@ -1771,13 +1776,13 @@ slideshow_switch_cb (gpointer data)
 
        if (!priv->slideshow_loop && slideshow_is_loop_end (window)) {
                eog_window_stop_fullscreen (window, TRUE);
-               return FALSE;
+               return G_SOURCE_REMOVE;
        }
 
        eog_thumb_view_select_single (EOG_THUMB_VIEW (priv->thumbview),
                                      EOG_THUMB_VIEW_SELECT_RIGHT);
 
-       return TRUE;
+       return G_SOURCE_REMOVE;
 }
 
 static void
@@ -1834,6 +1839,9 @@ slideshow_set_timeout (EogWindow *window)
 
        slideshow_clear_timeout (window);
 
+       if (window->priv->mode != EOG_WINDOW_MODE_SLIDESHOW)
+               return;
+
        if (window->priv->slideshow_switch_timeout <= 0)
                return;
 


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