diff --git a/0001-tdf-152073-tdf-153895-basicide-Set-bg-color-for-bord.patch b/0001-tdf-152073-tdf-153895-basicide-Set-bg-color-for-bord.patch new file mode 100644 index 0000000..2de8b98 --- /dev/null +++ b/0001-tdf-152073-tdf-153895-basicide-Set-bg-color-for-bord.patch @@ -0,0 +1,103 @@ +From 41570cf09b171a6ee1f04d39dd72399e2726d381 Mon Sep 17 00:00:00 2001 +From: Michael Weghorn +Date: Thu, 2 Mar 2023 12:56:13 +0100 +Subject: [PATCH] tdf#152073 tdf#153895 basicide: Set bg color for border win + +As described in the original commit to address tdf#152073 +("Glitch rendering line numbers in Basic IDE editor (kf5 only)"), +the fact that the KDE Breeze style's frame border is partly +transparent was causing artifacts in the Basic IDE: + + commit 6f4b8b7cfe2907b7da46eec6951a0e09b836a6de + Author: Michael Weghorn + Date: Tue Jan 31 16:08:53 2023 +0100 + + tdf#152073 qt: Draw background when drawing frame + + For native drawing of a frame (border), use + the window background color as default color. + + As mentioned in commit f39f21d92ec83c3a5062f29dd26214fc83012c06 + ("tdf#138010 (IV) VclScrolledWindow: Use actual border width"), + the Qt/KDE Breeze style uses a frame width of 2, with the + actual 1 pixel border being surrounded by a 1 pixel + padding/margin. + + Transparent background did not ensure that the 1 pixel + padding/margin is repainted and could thus result + in artifacts from what was painted to that location + previously (s. the Basic IDE editor example from + tdf#152073). + + [...] + +However, there are cases when a transparent background +is actually wanted, like in the print dialog (tdf#153895). + +Therefore, revert the original commit mentioned above +and explicitly set a background color for the border windows +of the involved windows in the Basic IDE instead, which is +in line with the alternative already mentioned in the above commit +("An alternative might be to explicitly draw the +background further up the call stack, [...]."), but enables +transparency in the qt5/qt6/kf5-specific drawing for +the frame again. + +Change-Id: Ifb4deb80c6ae245ec630a4fdc23f675e5587836c +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148117 +Tested-by: Jenkins +Reviewed-by: Michael Weghorn +(cherry picked from commit 699a1745f30cc0e89d59c6fc6ea742da5ff0ccea) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148098 +Reviewed-by: Adolfo Jayme Barrientos +--- + basctl/source/basicide/baside2b.cxx | 4 +++- + basctl/source/basicide/linenumberwindow.cxx | 4 +++- + vcl/qt5/QtGraphics_Controls.cxx | 1 - + 3 files changed, 6 insertions(+), 3 deletions(-) + +diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx +index b5deee9b6a9e..5947c2208b16 100644 +--- a/basctl/source/basicide/baside2b.cxx ++++ b/basctl/source/basicide/baside2b.cxx +@@ -252,7 +252,9 @@ EditorWindow::EditorWindow (vcl::Window* pParent, ModulWindow* pModulWindow) : + pCodeCompleteWnd(VclPtr::Create(this)) + { + set_id("EditorWindow"); +- SetBackground(Wallpaper(rModulWindow.GetLayout().GetSyntaxBackgroundColor())); ++ const Wallpaper aBackground(rModulWindow.GetLayout().GetSyntaxBackgroundColor()); ++ SetBackground(aBackground); ++ GetWindow(GetWindowType::Border)->SetBackground(aBackground); + SetPointer( PointerStyle::Text ); + SetHelpId( HID_BASICIDE_EDITORWINDOW ); + +diff --git a/basctl/source/basicide/linenumberwindow.cxx b/basctl/source/basicide/linenumberwindow.cxx +index 74ead4923863..24ee232c7c28 100644 +--- a/basctl/source/basicide/linenumberwindow.cxx ++++ b/basctl/source/basicide/linenumberwindow.cxx +@@ -21,7 +21,9 @@ LineNumberWindow::LineNumberWindow(vcl::Window* pParent, ModulWindow* pModulWind + , m_pModulWindow(pModulWindow) + , m_nCurYOffset(0) + { +- SetBackground(Wallpaper(GetSettings().GetStyleSettings().GetWindowColor())); ++ const Wallpaper aBackground(GetSettings().GetStyleSettings().GetWindowColor()); ++ SetBackground(aBackground); ++ GetWindow(GetWindowType::Border)->SetBackground(aBackground); + m_FontColor = GetSettings().GetStyleSettings().GetWindowTextColor(); + m_nBaseWidth = GetTextWidth("8"); + m_nWidth = m_nBaseWidth * 3 + m_nBaseWidth / 2; +diff --git a/vcl/qt5/QtGraphics_Controls.cxx b/vcl/qt5/QtGraphics_Controls.cxx +index 71386a6bd5ea..c647152606e8 100644 +--- a/vcl/qt5/QtGraphics_Controls.cxx ++++ b/vcl/qt5/QtGraphics_Controls.cxx +@@ -287,7 +287,6 @@ bool QtGraphics_Controls::drawNativeControl(ControlType type, ControlPart part, + break; + } + [[fallthrough]]; // QPalette::Window +- case ControlType::Frame: + case ControlType::Menubar: + case ControlType::WindowBackground: + m_image->fill(QApplication::palette().color(QPalette::Window).rgb()); +-- +2.39.2 + diff --git a/libreoffice.spec b/libreoffice.spec index 3f203de..7173ed0 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -55,7 +55,7 @@ Summary: Free Software Productivity Suite Name: libreoffice Epoch: 1 Version: %{libo_version}.2 -Release: 1%{?libo_prerelease}%{?dist} +Release: 2%{?libo_prerelease}%{?dist} # default new files are: MPLv2 # older files are typically: MPLv2 incorporating work under ASLv2 # nlpsolver is: LGPLv3 @@ -266,9 +266,10 @@ Patch2: 0001-Resolves-rhbz-1432468-disable-opencl-by-default.patch # backported Patch3: 0001-Revert-tdf-101630-gdrive-support-w-oAuth-and-Drive-A.patch Patch4: 0001-don-t-crash-with-disable-pdfium.patch +Patch5: 0001-tdf-152073-tdf-153895-basicide-Set-bg-color-for-bord.patch # TODO investigate these -Patch5: 0001-aarch64-failing-here.patch -Patch6: 0001-include-filename-if-the-test-fails.patch +Patch6: 0001-aarch64-failing-here.patch +Patch7: 0001-include-filename-if-the-test-fails.patch # not upstreamed Patch500: 0001-disable-libe-book-support.patch @@ -2272,6 +2273,9 @@ gtk-update-icon-cache -q %{_datadir}/icons/hicolor &>/dev/null || : %{_includedir}/LibreOfficeKit %changelog +* Thu Mar 09 2023 Caolán McNamara - 1:7.5.1.2-2 +- fix gray background in kf5 print preview + * Thu Mar 02 2023 Caolán McNamara - 1:7.5.1.2-1 - latest version