From 70179db81e5a7fff78b558de9f39521c44a16886 Mon Sep 17 00:00:00 2001 From: rubidium Date: Wed, 24 Aug 2011 12:18:53 +0000 Subject: (svn r22820) -Codechange: perform a full (re)draw cycle in the first draw during progress instead of waiting 200ms --- src/progress.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/progress.cpp') diff --git a/src/progress.cpp b/src/progress.cpp index ac34afd07..208f681a6 100644 --- a/src/progress.cpp +++ b/src/progress.cpp @@ -15,6 +15,7 @@ /** Are we in a modal progress or not? */ bool _in_modal_progress = false; +bool _first_in_modal_loop = false; /** Rights for the performing work. */ ThreadMutex *_modal_progress_work_mutex = ThreadMutex::New(); /** Rights for the painting. */ @@ -22,9 +23,23 @@ ThreadMutex *_modal_progress_paint_mutex = ThreadMutex::New(); /** * Set the modal progress state. + * @note Makes IsFirstModalProgressLoop return true for the next call. * @param state The new state; are we modal or not? */ void SetModalProgress(bool state) { _in_modal_progress = state; + _first_in_modal_loop = true; +} + +/** + * Check whether this is the first modal progress loop. + * @note Set by SetModalProgress, unset by calling this method. + * @return True if this is the first loop. + */ +bool IsFirstModalProgressLoop() +{ + bool ret = _first_in_modal_loop; + _first_in_modal_loop = false; + return ret; } -- cgit v1.2.3-54-g00ecf