[evince/wip/gpoo/687-increase-duration-resolution] libview: Increase page duration resolution



commit 12a638b8c739256b4300f44779f0045a9c23be02
Author: Marc Vinyals <vinyals kth se>
Date:   Sun Nov 22 22:23:00 2015 +0000

    libview: Increase page duration resolution
    
    In presentation mode, if a page duration is specified, then the viewer
    should advance to the next page. The current time resolution is
    multiples of 1 second, which is too coarse for animations where each
    page lasts for a fraction of a second.
    
    By using g_timeout_add we increase the duration resolution, as
    duration is a double, it can contain fractions of seconds, and
    takes the advantage that g_timeout_add resolution is miliseconds.
    
    Fixes #637
    
    Signed-off-by: Germán Poo-Caamaño <gpoo gnome org>

 libview/ev-view-presentation.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/libview/ev-view-presentation.c b/libview/ev-view-presentation.c
index 228ecc14..4ca55515 100644
--- a/libview/ev-view-presentation.c
+++ b/libview/ev-view-presentation.c
@@ -260,9 +260,9 @@ ev_view_presentation_transition_start (EvViewPresentation *pview)
                                                             pview->current_page);
        if (duration >= 0) {
                        pview->trans_timeout_id =
-                               g_timeout_add_seconds (duration,
-                                                      (GSourceFunc) transition_next_page,
-                                                      pview);
+                               g_timeout_add (duration * 1000,
+                                              (GSourceFunc) transition_next_page,
+                                              pview);
        }
 }
 


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