From 6adbf899d4f30685c9a0400a508d0eb673c77e50 Mon Sep 17 00:00:00 2001 From: David Capello Date: Wed, 25 Sep 2019 14:33:56 -0300 Subject: [PATCH] Fix progress bar applying filters (fix #2152, related to 165940164218d8ad10c43f39d08f0559e859098d) Regression introduced in 4264f199cdf398659fd90db4c572f42c47fd5988 --- src/app/ui/timeline/timeline.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/app/ui/timeline/timeline.cpp b/src/app/ui/timeline/timeline.cpp index 7031d4aa9..3bc7ab511 100644 --- a/src/app/ui/timeline/timeline.cpp +++ b/src/app/ui/timeline/timeline.cpp @@ -1535,9 +1535,10 @@ void Timeline::onPaint(ui::PaintEvent& ev) goto paintNoDoc; try { - // Lock the sprite to read/render it. We wait 1/4 secs in case - // the background thread is making a backup. - const DocReader docReader(m_document, 250); + // Lock the sprite to read/render it. Here we don't wait if the + // document is locked (e.g. a filter is being applied to the + // sprite) to avoid locking the UI. + const DocReader docReader(m_document, 0); if (m_redrawMarchingAntsOnly) { drawClipboardRange(g); @@ -1676,6 +1677,8 @@ void Timeline::onPaint(ui::PaintEvent& ev) #endif } catch (const LockedDocException&) { + // The sprite is locked, so we defer the rendering of the sprite + // for later. noDoc = true; defer_invalid_rect(g->getClipBounds().offset(bounds().origin())); }