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

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