summaryrefslogtreecommitdiff
path: root/vcl/source/control/prgsbar.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/control/prgsbar.cxx')
-rw-r--r--vcl/source/control/prgsbar.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/vcl/source/control/prgsbar.cxx b/vcl/source/control/prgsbar.cxx
index 376ed91cfcdd..2531423a922f 100644
--- a/vcl/source/control/prgsbar.cxx
+++ b/vcl/source/control/prgsbar.cxx
@@ -22,6 +22,8 @@
#include <vcl/prgsbar.hxx>
#include <vcl/settings.hxx>
#include <sal/log.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/idle.hxx>
#define PROGRESSBAR_OFFSET 3
#define PROGRESSBAR_WIN_OFFSET 2
@@ -174,6 +176,16 @@ void ProgressBar::SetValue( sal_uInt16 nNewPercent )
{
mnPercent = nNewPercent;
Invalidate();
+
+ // Make sure the progressbar is actually painted even if the caller is busy with its task,
+ // so the main loop would not be invoked.
+ Idle aIdle("ProgressBar::SetValue aIdle");
+ aIdle.SetPriority(TaskPriority::POST_PAINT);
+ aIdle.Start();
+ while (aIdle.IsActive())
+ {
+ Application::Yield();
+ }
}
}