[Libreoffice-commits] core.git: Branch 'libreoffice-6-3-1' - vcl/source
Miklos Vajna (via logerrit)
logerrit at kemper.freedesktop.org
Mon Aug 19 11:08:41 UTC 2019
vcl/source/edit/texteng.cxx | 3 +++
vcl/source/uitest/uiobject.cxx | 5 +++++
vcl/source/window/aboutdialog.cxx | 2 ++
3 files changed, 10 insertions(+)
New commits:
commit 813474dbe134e3dda538d0f534032a71f8f3b9c0
Author: Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Mon Aug 12 11:35:51 2019 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Aug 19 13:08:06 2019 +0200
tdf#118856 vcl: avoid flicker in the about dialog
There were two problems here:
1) The flickering widget in question is VclMultiLineEdit, but it wasn't
like its own painting caused a flicker, rather the calling
vcl::Window::PushPaintHelper() already erased the widget and later the
widget painted itself. So the easy way with vcl::BufferDevice is not
enough here. VclMultiLineEdit seems to be working with double buffering
just fine, so enable that in the vcl::AboutDialog ctor.
2) Now that text did not flicker, its background was wrong. In case the
NWF determines some gray background, the background was white for most
text when there was no selection.
When there was selection, then the after-selection area (in a single
line) was fine, but nothing else.
It seems TextEngine::ImpPaint() assumes that no need to set a default
text fill color before drawing text, but the above shows that there is
difference between the starting state and after clearing away a custom
color with SetTextFillColor(). So fix this problem by always explicitly
calling SetTextFillColor() before text paint: either setting the
selection color or the default one.
This brings improvement for the Windows GDI backend; Windows GL, Linux
gen/gtk/gtk3 is unchanged in practice.
(cherry picked from commit 7eb37a422f2e66bc177d72404c53659a248661ca)
Change-Id: Ie7ff3a7f36bedf73424ea579a00588bd8858d6c4
Reviewed-on: https://gerrit.libreoffice.org/77600
Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx
index b6835dbc07a2..cab426c8b001 100644
--- a/vcl/source/edit/texteng.cxx
+++ b/vcl/source/edit/texteng.cxx
@@ -1964,6 +1964,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, tools:
{
const sal_Int32 nL = pSelStart->GetIndex() - nTmpIndex;
pOutDev->SetFont( aFont);
+ pOutDev->SetTextFillColor();
aPos.setX( rStartPos.X() + ImpGetOutputOffset( nPara, &rLine, nTmpIndex, nTmpIndex+nL ) );
pOutDev->DrawText( aPos, pPortion->GetNode()->GetText(), nTmpIndex, nL );
nTmpIndex = nTmpIndex + nL;
@@ -1989,6 +1990,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, tools:
if ( nTmpIndex < nEnd )
{
nL = nEnd-nTmpIndex;
+ pOutDev->SetTextFillColor();
aPos.setX( rStartPos.X() + ImpGetOutputOffset( nPara, &rLine, nTmpIndex, nTmpIndex+nL ) );
pOutDev->DrawText( aPos, pPortion->GetNode()->GetText(), nTmpIndex, nEnd-nTmpIndex );
}
@@ -1997,6 +1999,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, tools:
}
if ( !bDone )
{
+ pOutDev->SetTextFillColor();
aPos.setX( rStartPos.X() + ImpGetOutputOffset( nPara, &rLine, nTmpIndex, nEnd ) );
pOutDev->DrawText( aPos, pPortion->GetNode()->GetText(), nTmpIndex, nEnd-nTmpIndex );
}
diff --git a/vcl/source/uitest/uiobject.cxx b/vcl/source/uitest/uiobject.cxx
index b8932913cf53..2a86abcdd4ef 100644
--- a/vcl/source/uitest/uiobject.cxx
+++ b/vcl/source/uitest/uiobject.cxx
@@ -273,6 +273,11 @@ WindowUIObject::WindowUIObject(const VclPtr<vcl::Window>& xWindow):
StringMap WindowUIObject::get_state()
{
+ // Double-buffering is not interesting for uitesting, but can result in direct paint for a
+ // double-buffered widget, which is incorrect.
+ if (mxWindow->SupportsDoubleBuffering())
+ mxWindow->RequestDoubleBuffering(false);
+
StringMap aMap;
aMap["Visible"] = OUString::boolean(mxWindow->IsVisible());
aMap["ReallyVisible"] = OUString::boolean(mxWindow->IsReallyVisible());
diff --git a/vcl/source/window/aboutdialog.cxx b/vcl/source/window/aboutdialog.cxx
index b8a8aa595982..3bf2dc0155d1 100644
--- a/vcl/source/window/aboutdialog.cxx
+++ b/vcl/source/window/aboutdialog.cxx
@@ -56,6 +56,8 @@ AboutDialog::AboutDialog(vcl::Window* pParent, WinBits nStyle, Dialog::InitFlag
m_xBuilder->get(m_xDescriptionText, "description");
m_xBuilder->get(m_xCopyrightText, "copyright");
m_xBuilder->get(m_xBuildIdLink, "buildIdLink");
+
+ m_xVersion->RequestDoubleBuffering(true);
}
void AboutDialog::set_content_area(VclBox* pBox)
More information about the Libreoffice-commits
mailing list