Blame SOURCES/0001-Related-tdf-100925-background-not-getting-set-under-.patch

20aa85
From dd53132119ca8640eea82bfaf26c85f4542ce8c2 Mon Sep 17 00:00:00 2001
20aa85
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
20aa85
Date: Thu, 12 Apr 2018 14:53:20 +0100
20aa85
Subject: [PATCH] Related: tdf#100925 background not getting set under X
20aa85
 sometimes
20aa85
20aa85
not sure why this is the case, but it is reminiscent of rhbz#1283420 which
20aa85
results in missing glyphs in some circumstances
20aa85
X11CairoTextRender::getCairoContext has a hack in it for that problem, whic
20aa85
forces a read from the underlying X Drawable before writing to it which seems
20aa85
to have the effect of syncing it up.
20aa85
20aa85
So, just before drawing the bg, draw a glyph on it to get it synced, and then
20aa85
overwrite it.
20aa85
20aa85
Change-Id: I2ffff7e8e989b91821869d8b75a59728ac513d1b
20aa85
Reviewed-on: https://gerrit.libreoffice.org/52819
20aa85
Tested-by: Jenkins <ci@libreoffice.org>
20aa85
Reviewed-by: Eike Rathke <erack@redhat.com>
20aa85
---
20aa85
 sc/source/ui/view/gridwin4.cxx | 7 ++++++-
20aa85
 1 file changed, 6 insertions(+), 1 deletion(-)
20aa85
20aa85
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
20aa85
index cc8b0ee..ba3622d 100644
20aa85
--- a/sc/source/ui/view/gridwin4.cxx
20aa85
+++ b/sc/source/ui/view/gridwin4.cxx
20aa85
@@ -1038,7 +1038,12 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
20aa85
         }
20aa85
 
20aa85
         // paint the background
20aa85
-        rDevice.DrawRect(rDevice.PixelToLogic(aBackground));
20aa85
+        Rectangle aLogicRect(rDevice.PixelToLogic(aBackground));
20aa85
+        //tdf#100925, rhbz#1283420, Draw some text here, to get
20aa85
+        //X11CairoTextRender::getCairoContext called, so that the forced read
20aa85
+        //from the underlying X Drawable gets it to sync.
20aa85
+        rDevice.DrawText(aLogicRect.BottomLeft(), " ");
20aa85
+        rDevice.DrawRect(aLogicRect);
20aa85
 
20aa85
         // paint the editeng text
20aa85
         Rectangle aEditRect(Point(nScrX, nScrY), Size(aOutputData.GetScrW(), aOutputData.GetScrH()));
20aa85
-- 
20aa85
2.14.3
20aa85