summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-05-14 12:31:55 +0200
committerMiklos Vajna <vmiklos@collabora.com>2020-05-14 13:14:24 +0200
commit52389ed19da6bcfdedef909532913ff3e2ab4afc (patch)
tree08d04231fbd23591df6876c7d1e433d581fccda2
parent7e7d7e5f1ec0aa678009b2d0993a9ccc05bb1ea8 (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. Change-Id: I256372ad30184cc150d6819dd61cdd38af7d83ba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94189 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
-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 c9cdd199e6e4..7a9e24a71e6f 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);
}