vcl/source/control/prgsbar.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+)
New commits: commit de7148f3a7c9ac5eb0f15e5ddc1d15aef8882fea Author: Miklos Vajna <[email protected]> AuthorDate: Thu Jun 13 10:06:04 2019 +0200 Commit: Thorsten Behrens <[email protected]> CommitDate: Fri Jun 5 01:09:30 2020 +0200 tdf#95173 vcl: fix not drawn progressbar widget from UNO Commit e6c2951f1957224aa0e7dc97b33b0450c41f92f7 (delegate RenderContext, invalidate - prgsbar, scrbar, 2015-04-29) switched ProgressBar::SetValue() from direct partial paint to invalidate + paint later, which means setting a progressbar value, then using an external sleep (such as Python's time.sleep()) no longer results in an updated progressbar. Solve the problem by explicitly processing all events with at least TaskPriority::REPAINT priority after the invalidate in ProgressBar::SetValue(), which is similar to what the Wait implementation in the basic runtime does. (cherry picked from commit f7157f04fab298423e2c4f6a7e5f8e361164b15f) Change-Id: I86475fb899f16b72ebefe9d3056c92cedeff4439 Reviewed-on: https://gerrit.libreoffice.org/73952 Tested-by: Jenkins Reviewed-by: Miklos Vajna <[email protected]> (cherry picked from commit 66bfaa01486891627b0748c4ba7b8d86e0fdc439) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95491 Tested-by: Thorsten Behrens <[email protected]> Reviewed-by: Thorsten Behrens <[email protected]> diff --git a/vcl/source/control/prgsbar.cxx b/vcl/source/control/prgsbar.cxx index ac21e7c98ca3..3d440fa7be08 100644 --- a/vcl/source/control/prgsbar.cxx +++ b/vcl/source/control/prgsbar.cxx @@ -20,6 +20,8 @@ #include <vcl/status.hxx> #include <vcl/prgsbar.hxx> #include <vcl/settings.hxx> +#include <vcl/svapp.hxx> +#include <vcl/idle.hxx> #define PROGRESSBAR_OFFSET 3 #define PROGRESSBAR_WIN_OFFSET 2 @@ -181,6 +183,16 @@ void ProgressBar::SetValue( sal_uInt16 nNewPercent ) mnPreviousPercent = mnPercent; 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(); + } } } _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
