Bug 149611 - Page color doesn't adhere to dark theme (kf5)
Summary: Page color doesn't adhere to dark theme (kf5)
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
7.3.4.2 release
Hardware: All Linux (All)
: medium normal
Assignee: Michael Weghorn
URL: https://ask.libreoffice.org/t/how-to-...
Whiteboard: target:24.2.0
Keywords:
Depends on:
Blocks: KDE, KF5 Linux-Dark-Mode
  Show dependency treegraph
 
Reported: 2022-06-18 23:30 UTC by `{third: "Beedell", first: "Roke"}`{.JSON5}
Modified: 2024-01-20 18:33 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Depiction of the problem. (97.54 KB, image/png)
2023-08-26 00:51 UTC, `{third: "Beedell", first: "Roke"}`{.JSON5}
Details
LO with dark theme applied (59.35 KB, image/png)
2023-08-27 21:07 UTC, Thesmallest
Details
LO with light theme applied. (75.99 KB, image/png)
2023-08-27 21:09 UTC, Thesmallest
Details

Note You need to log in before you can comment on or make changes to this bug.
Description `{third: "Beedell", first: "Roke"}`{.JSON5} 2022-06-18 23:30:32 UTC
Description:
As "http://i.redd.it/ecdrtquwed691.png" depicts, the page does not adhere to the theme of the system automatically. This is present within Web View too, which easily demonstrates why this feature is necessary and obviously should already be present.

Steps to Reproduce:
Apply any theme to your device and observe how LibreOffice's page does not adhere to my colourative customization, but rather to custom colouration.

Actual Results:
LibreOffice's page does not adhere to my colourative customization, but rather to its custom colourative preference.

Expected Results:
LibreOffice's page should adhere to my colourative customization, but rather to its custom colourative preference.


Reproducible: Always


User Profile Reset: No


OpenGL enabled: Yes

Additional Info:
The provided "LibreOffice Dark Theme" is inadequate even as a manual method of remediation of this problem, because it is infeasible to maintain by those that frequently replace the theme of their system, and is able to be unpleasant if, during daytime, the light version was utilized, and has not been switched to the dark theme before LibreOffice is invoked during darkness.
Comment 1 Buovjaga 2023-02-22 15:36:04 UTC
There have been many improvements to the dark theme functionality. 7.5 was released with the improvements and there is also this much-requested thing coming in 7.5.1: bug 153229. Is there anything missing in 7.5 in your opinion?

Set to NEEDINFO.
Change back to UNCONFIRMED, if the problem persists. Change to RESOLVED WORKSFORME, if the problem went away.
Comment 2 QA Administrators 2023-08-22 03:06:07 UTC Comment hidden (obsolete)
Comment 3 `{third: "Beedell", first: "Roke"}`{.JSON5} 2023-08-26 00:51:50 UTC
Created attachment 189162 [details]
Depiction of the problem.

https://bugs.documentfoundation.org/show_bug.cgi?id=149611#c1
Comment 4 `{third: "Beedell", first: "Roke"}`{.JSON5} 2023-08-26 21:59:08 UTC
> https://ask.libreoffice.org/t/how-to-make-writer-page-adhere-to-system-lo-theme/95069/2?u=rokejulianlockhart

No, although it is a significant improvement.
Comment 5 V Stuart Foote 2023-08-27 11:25:08 UTC
Can not confirm on Windows builds of 7.6.0.3 or of recent master against 24.2.0

For work done on see also bug 153229

From Start Center --> Tools --> Options --> Application colors the the default 'Automatic' Custom colors "scheme" offers three choices in the 'Automatic' list box:  'System theme', 'Light' (the Default), or 'Dark'

On Windows 10 os/DE the 'System theme' selection *does* provide a dark canvas bg with contrasting fg.  While the default 'Light' selection maintains legacy behavior.  And, 'Dark' forces the LIbreOffice UI into a Dark mode.

Unable to test against Linux os/DE flavors at the moment--but this => WFM
Comment 6 `{third: "Beedell", first: "Roke"}`{.JSON5} 2023-08-27 14:20:41 UTC
Thanks for that. It's great to hear. Hopefully this is just a bug experienced by KDE users.
Comment 7 Thesmallest 2023-08-27 21:07:56 UTC
Created attachment 189181 [details]
LO with dark theme applied
Comment 8 Thesmallest 2023-08-27 21:09:17 UTC
Created attachment 189182 [details]
LO with light theme applied.

(also see dark mode in picture above)

Since the pictures provided by some users show a problem regarding dark theme on linux, I want to post here that it had been RESOLVED in the current daily build (maybe earlier too).

For reference, here's my post from ask.libreoffice.org: https://ask.libreoffice.org/t/how-to-make-writer-page-adhere-to-system-lo-theme/95069/13?u=thesmallest


I downloaded the daily build from 2023-Aug-27 here: https://dev-builds.libreoffice.org/daily/master/Linux-rpm_deb-x86_64@tb99-TDF/2023-08-27_04.31.13/LibreOfficeDev_24.2.0.0.alpha0_Linux_x86-64_deb.tar.gz.

System info (inside virtualbox):
OS: Debian GNU/Linux 12 (bookworm) 64-bit
Windowing system: Wayland
DE: Gnome

Libreoffice version (help > about):
Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: e16e84c44fc7517529c8a183fbd8f97c0c3e380e
CPU threads: 4;
OS: Linux 6.1;
UI render: default;
VCL: gtk3
Locale: en-US (en_US.UTF-8);
UI: en-US
Calc: threaded

I had to go and change "automatic" from "light" (default) to "system theme" in options > application colors first.

Also if I change gnome from light to dark (and vice versa) while the above mentioned libreoffice is still opened, the theme gets applied immediatly
 and correctly.

Not sure if I should set the status to RESOLVED here.


See attachments for screenshots.
Comment 9 `{third: "Beedell", first: "Roke"}`{.JSON5} 2023-08-27 21:38:11 UTC
Can you confirm that the behaviour is actually different to the version I quoted? I can't easily test anything newer than what I'm using currently. If the listed version is indeed as I describe, and the newer version as you describe, set this as resolved. Better defaults would be a separate issue.
Comment 10 Thesmallest 2023-08-27 23:32:48 UTC
(In reply to third="Beedell", first="Roke" from comment #9)
> Can you confirm that the behaviour is actually different to the version I
> quoted? I can't easily test anything newer than what I'm using currently. If
> the listed version is indeed as I describe, and the newer version as you
> describe, set this as resolved. Better defaults would be a separate issue.

Okay, so (on GNOME):
LO versions 7.3.4.2 and 7.4.7.2: If I turn on dark theme in my OS, nothing in LO changes. UI stays like it does in light mode, page doesn't change. However, if I go to tools > options > application colors and choose "Libreoffice Dark" in "Scheme", then the page changes to black (and black text is displayed white). UI doesn't change, no matter what I do.


In LO version 24.2.0.0.alpha0+ it works as intended (after changing the setting as described). LO will apply the appropriate theme (ui and page) and you don't have to change anything yourself once you changed that setting I described in comment #8.


So yes: I can confirm that the behavior is different than on your system.

However, I also downloaded KDE Plasma (5.27.5 under wayland) with debian 12, since you mentioned you use it:
LO version 7.3.4.2: If your plasma is set to dark (settings > appearance > global theme > breeze dark) LO ui changes to black as well as the page. Works exactly as intended.
LO version 7.4.7.2: Page goes black, ui stays like it would in light mode.
LO version 24.2.0.0.alpha0+: UI changes accordingly, page *only* if manually set to dark, else it stays white. However, ui changes according to the system if I turn on / off dark mode. (tested with KDE plasma in X11 and same happens)

I noticed warnings in the terminal if I execute LO 24.2.0.0.alpha0+ (with KDE) regarding VCL. Seems like it fails to load icons and images but I don't know how that's related to the page display.

I also set SAL_USE_VCLPLUGIN=gen and opened LO 24.2.0.0.alpha0+ with the terminal again. Now neither the page nor the ui change to dark mode (SAL_USE_VCLPLUGIN=gtk is the default).



I'll change the status to NEW, since it seems to be an KDE plasma related bug. Also, it's NOT RESLOVED for KDE plasma.
Comment 11 Heiko Tietze 2023-08-28 08:04:52 UTC
(In reply to Caolán McNamara from bug 153229 comment 39)
> (In reply to Heiko Tietze from comment #35)
> > The dropdown is hidden on Linux/Qt but shown when running with
> > SAL_USE_VCLPLUGIN gtk3/gtk4. 
> 
> As far as I know there isn't explicit dark mode support in the qt/kf
> backend. It already doesn't seem to "know" if its in dark mode in order to
> automatically select an appropriate icon theme. For me with hidpi and
> wayland a lot of the basic functionality is not really functional with
> misplaced menus and awkward font sizes. If we want to enable it for qt/kf
> then someone else will have to figure out how to do it.

I suggest to resolve this ticket as NAB and to create another follow-up to bug 153229 (which introduced the appearance switch) for kf5/qt6. 

Meanwhile, you can manually switch to the dark application colors, see bug 152184.
Comment 12 Michael Weghorn 2023-09-02 08:57:50 UTC
(In reply to Heiko Tietze from comment #11)
> I suggest to resolve this ticket as NAB and to create another follow-up to
> bug 153229 (which introduced the appearance switch) for kf5/qt6. 
> 
> Meanwhile, you can manually switch to the dark application colors, see bug
> 152184.

Let's just use this bug report for that.

Pending Gerrit change that makes kf5/qt6 automatically use dark application colors when "Tools" -> "Options" -> "LibreOffice(Dev)" -> "Application Colors" -> "Automatic" is set to "System Theme" and a dark theme is used in KDE Plasma.
https://gerrit.libreoffice.org/c/core/+/156467
Comment 13 `{third: "Beedell", first: "Roke"}`{.JSON5} 2023-09-02 13:24:36 UTC
I can confirm that LO 7.6 Writer (snap id CpUkI0qPIIBVRsjy49adNq4D6Ra72y4v from `snap install --channel=latest/edge`) uses the dark theme on cpe:/o:opensuse:tumbleweed:20230828, unlike https://download.opensuse.org/repositories/openSUSE:/Factory/standard/x86_64/libreoffice-7.6.1.1-1.1.x86_64.rpm
Comment 14 Commit Notification 2023-09-02 13:42:56 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/19b8bac2aa59d02968c33ac6f83c66907d5ab94c

tdf#149611 qt: Make auto-selection of dark app colors work

It will be available in 24.2.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.
Comment 15 Michael Weghorn 2023-09-02 13:46:06 UTC
(In reply to third="Beedell", first="Roke" from comment #13)
> I can confirm that LO 7.6 Writer (snap id CpUkI0qPIIBVRsjy49adNq4D6Ra72y4v
> from `snap install --channel=latest/edge`) uses the dark theme on
> cpe:/o:opensuse:tumbleweed:20230828, unlike
> https://download.opensuse.org/repositories/openSUSE:/Factory/standard/x86_64/
> libreoffice-7.6.1.1-1.1.x86_64.rpm

Possibly the former is using the gtk3 VCL plugin while the latter uses kf5.
This can bee senn in "Help" -> "About LibreOffice".

With the commit from commit 14, auto-selection should work with the kf5 VCL plugin as well, so I'm closing this bug as fixed.
Comment 16 `{third: "Beedell", first: "Roke"}`{.JSON5} 2023-09-02 13:54:06 UTC
> Possibly the former is using the gtk3 VCL plugin while the latter uses kf5.
> This can bee senn in "Help" -> "About LibreOffice".

You're correct.
Comment 17 Thesmallest 2023-09-03 21:19:16 UTC
(In reply to Commit Notification from comment #14)
> Michael Weghorn committed a patch related to this issue.
> It has been pushed to "master":
> 
> https://git.libreoffice.org/core/commit/
> 19b8bac2aa59d02968c33ac6f83c66907d5ab94c
> 
> tdf#149611 qt: Make auto-selection of dark app colors work
> 
> It will be available in 24.2.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.

CONFIRMED FIXED with current daily in KDE Plasma (5.27.5).

Downloaded from: https://dev-builds.libreoffice.org/daily/master/Linux-rpm_deb-x86_64@tb99-TDF/2023-09-03_04.38.37/LibreOfficeDev_24.2.0.0.alpha0_Linux_x86-64_deb.tar.gz

About > help:
Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 3c7a35dd28fbc337a23473873b3dd47392b883ae
CPU threads: 4; OS: Linux 6.1; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

Had to set following setting first: Options > LibreofficeDev > Application colors > Automatic > System Theme.

Also checked with GNOME – no breakage found.

System info (inside virtualbox):
OS: Debian GNU/Linux 12 (bookworm) 64-bit
Windowing system: Wayland
Comment 18 Michael Weghorn 2023-09-04 06:15:48 UTC
(In reply to Thesmallest from comment #17)
> CONFIRMED FIXED with current daily in KDE Plasma (5.27.5).

Great, thanks!
Comment 19 `{third: "Beedell", first: "Roke"}`{.JSON5} 2024-01-20 17:25:31 UTC
(In reply to Michael Weghorn from comment #18)
> (In reply to Thesmallest from comment #17)
> > CONFIRMED FIXED with current daily in KDE Plasma (5.27.5).
> 
> Great, thanks!

Per https://ask.libreoffice.org/t/automatic-system-theme-should-set-document-colour-to-theme-colours/100696/5?u=rokejulianlockhart, it seems to me like that this has reappeared. I'm using https://download.opensuse.org/repositories/openSUSE:/Factory/standard/x86_64/plasma5-desktop-5.27.10-1.1.x86_64.rpm on cpe:/o:opensuse:tumbleweed:20240118. Can anyone reproduce?
Comment 20 Buovjaga 2024-01-20 17:35:15 UTC
(In reply to `{third: "Beedell", first: "Roke"}`{.JSON5} from comment #19)
> (In reply to Michael Weghorn from comment #18)
> > (In reply to Thesmallest from comment #17)
> > > CONFIRMED FIXED with current daily in KDE Plasma (5.27.5).
> > 
> > Great, thanks!
> 
> Per
> https://ask.libreoffice.org/t/automatic-system-theme-should-set-document-
> colour-to-theme-colours/100696/5?u=rokejulianlockhart, it seems to me like
> that this has reappeared. I'm using
> https://download.opensuse.org/repositories/openSUSE:/Factory/standard/x86_64/
> plasma5-desktop-5.27.10-1.1.x86_64.rpm on
> cpe:/o:opensuse:tumbleweed:20240118. Can anyone reproduce?

In the forum topic, you say you use 7.6.4.1 while this fix is only in 24.2.0. Can you try with 24.2.0, please?
Comment 21 `{third: "Beedell", first: "Roke"}`{.JSON5} 2024-01-20 18:24:00 UTC
(In reply to Buovjaga from comment #20)
> (In reply to `{third: "Beedell", first: "Roke"}`{.JSON5} from comment #19)
> > (In reply to Michael Weghorn from comment #18)
> > > (In reply to Thesmallest from comment #17)
> > > > CONFIRMED FIXED with current daily in KDE Plasma (5.27.5).
> > > 
> > > Great, thanks!
> > 
> > Per
> > https://ask.libreoffice.org/t/automatic-system-theme-should-set-document-
> > colour-to-theme-colours/100696/5?u=rokejulianlockhart, it seems to me like
> > that this has reappeared. I'm using
> > https://download.opensuse.org/repositories/openSUSE:/Factory/standard/x86_64/
> > plasma5-desktop-5.27.10-1.1.x86_64.rpm on
> > cpe:/o:opensuse:tumbleweed:20240118. Can anyone reproduce?
> 
> In the forum topic, you say you use 7.6.4.1 while this fix is only in
> 24.2.0. Can you try with 24.2.0, please?

Indeed, you're correct - `sudo snap install libreoffice --channel=latest/beta` with the same preferences worked: https://ask.libreoffice.org/t/automatic-system-theme-should-set-document-colour-to-theme-colours/100696/6?u=rokejulianlockhart.