Bug 136866 - Background color for mulitline edit not applied (kf5)
Summary: Background color for mulitline edit not applied (kf5)
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
7.1.0.0.alpha0+
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.1.0
Keywords:
Depends on:
Blocks: KDE, KF5
  Show dependency treegraph
 
Reported: 2020-09-18 04:28 UTC by Michael Weghorn
Modified: 2020-10-23 04:16 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot showing missing background color for multiline edit with kf5 VCL plugin (19.07 KB, image/png)
2020-09-18 04:28 UTC, Michael Weghorn
Details
Patch that adds test ouptut showing that color is not passed for qt5 (2.10 KB, patch)
2020-09-18 04:33 UTC, Michael Weghorn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Weghorn 2020-09-18 04:28:01 UTC
Created attachment 165645 [details]
Screenshot showing missing background color for multiline edit with kf5 VCL plugin

This is a follow-up for tdf#136094.

Steps to reproduce:

0. Use the kf5 VCL plugin (used by default in KDE Plasma session), e.g. by setting environment variable SAL_USE_VCLPLUGIN=kf5 
1. Open attachment 164654 [details] from bug 136094
2. go to "Tools" -> "Macros" -> "Organize Dialogs"
3. open the test dialog contained in the document: "formcontrol_colors.odt" -> "Standard" -> "testdialog", click "Edit"
  -> a dialog with various controls shows up, some of which have a background color set
4. start the preview dialog (third icon in the toolbar at the bottom)
5. compare the colors shown in the preview dialog to those in the editable dialog shown before

Actual Result: background color missing for the multiline edit at the top (s. attached screenshot)

Expected Result: Background colors in the preview dialog should be the same as those shown/set in previously, i.e. the multiline edit should have red background.

More info:

After the 2 commits mentioned in tdf#136094, background colors basically work for gtk3 and kf5. However, for some reason, the multiline edit does not yet work for kf5, s.a. commit message in https://git.libreoffice.org/core/+/391f17a5fbcf9cd918efa10321219f87409d2412%5E%21

The two commits might be a good place to start to find the relevant place.


Version: 7.1.0.0.alpha0+
Build ID: 007e6063931bd87d6ce15deb65b9adc823f74ce0
CPU threads: 12; OS: Linux 5.8; UI render: default; VCL: kf5
Locale: en-GB (en_GB.UTF-8); UI: en-US
Calc: threaded
Comment 1 Michael Weghorn 2020-09-18 04:33:17 UTC
Created attachment 165646 [details]
Patch that adds test ouptut showing that color is not passed for qt5

The attached patch demonstrates that the background color is not passed correctly into Qt5Graphics_Controls::drawNativeControl, while GtkSalGraphics::drawNativeControl does get the correct one.

Output when using kf5 VCL plugin with that patch in place:

> warn:vcl.test:17103:17103:vcl/qt5/Qt5Graphics_Controls.cxx:254: multilineedit, rBackgroundColor: c[ffffffff]
> warn:vcl.test:17103:17103:vcl/qt5/Qt5Graphics_Controls.cxx:254: multilineedit, rBackgroundColor: c[ffffffff]

-> COL_AUTO, is passed here, i.e. not the correct color

Output when using gtk3 VCL plugin:

> warn:vcl.test:17264:17264:vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx:2322: multilineedit, rBackgroundColor: c[ff383800]
> warn:vcl.test:17264:17264:vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx:2322: multilineedit, rBackgroundColor: c[ff383800]
> warn:vcl.test:17264:17264:vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx:2322: multilineedit, rBackgroundColor: c[ff383800]
> warn:vcl.test:17264:17264:vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx:2322: multilineedit, rBackgroundColor: c[ff383800]

-> proper color is passed

What would probably have to be done here is to find out why the color is not passed as expected for the qt5/kf5 case.
Comment 2 Commit Notification 2020-10-22 10:21:03 UTC
Jan-Marek Glogowski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/2859febef0dd59e6714032887f1f4ababf0b1044

tdf#136866 VCL don't drop the control background

It will be available in 7.1.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.