summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-05-14 12:31:55 +0200
committerCaolán McNamara <caolanm@redhat.com>2020-05-15 16:20:01 +0200
commitd6304a7db28f92bbe5cd98648aa133d64c05b5ff (patch)
tree32d9480a53136462f768c4d132ef3b9fce50c73a /vcl/source
parent98d3ef152b7655e1aab2023304d4644380d5850c (diff)
tdf#132788 vcl: fix redraw on theme change
Regression from commit f4e0cc1ff145287f80738f070a8c46a64b2f76d1 (tdf#92079 vcl: fix missing image background on dialog from basic, 2019-06-13), the original scenario was about an unexpected change from bitmap wallpaper to a non-bitmap one. That means the condition for the above change can be more strict: just restore the old wallpaper if it's now a non-bitmap one, otherwise leave it alone. This way the above scenario keeps working and changing themes again doesn't require a restart of the process. (cherry picked from commit 52389ed19da6bcfdedef909532913ff3e2ab4afc) Change-Id: I256372ad30184cc150d6819dd61cdd38af7d83ba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94194 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/window/paint.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index a99ae752de45..6e6b8b4bfe6c 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -302,9 +302,11 @@ void PaintHelper::DoPaint(const vcl::Region* pRegion)
// direct painting
Wallpaper aBackground = m_pWindow->GetBackground();
m_pWindow->ApplySettings(*m_pWindow);
- // Restore lost bitmap background.
- if (aBackground.IsBitmap())
+ // Restore bitmap background if it was lost.
+ if (aBackground.IsBitmap() && !m_pWindow->GetBackground().IsBitmap())
+ {
m_pWindow->SetBackground(aBackground);
+ }
m_pWindow->PushPaintHelper(this, *m_pWindow);
m_pWindow->Paint(*m_pWindow, m_aPaintRect);
}