Bug 147237 - Dynamic theme gtk switching only partially switches colors
Summary: Dynamic theme gtk switching only partially switches colors
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
7.3.0.3 release
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.4.0 target:7.3.4
Keywords:
Depends on:
Blocks: gtk3-themeing
  Show dependency treegraph
 
Reported: 2022-02-06 21:30 UTC by TheStroyer
Modified: 2023-04-15 09:20 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Comparison between correct behavior (right) and wrong behavior (left) (56.38 KB, image/png)
2022-03-08 16:55 UTC, TheStroyer
Details
Font selection (2.78 KB, image/png)
2022-03-13 22:52 UTC, TheStroyer
Details
Side bar (34.44 KB, image/png)
2022-03-13 22:53 UTC, TheStroyer
Details
Bad (sidebar) (9.84 KB, image/png)
2023-04-12 14:42 UTC, TheStroyer
Details
Good (sidebar) (8.48 KB, image/png)
2023-04-12 14:43 UTC, TheStroyer
Details
Bad (completion) (4.42 KB, image/png)
2023-04-12 14:44 UTC, TheStroyer
Details
Good (completion) (4.68 KB, image/png)
2023-04-12 14:45 UTC, TheStroyer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description TheStroyer 2022-02-06 21:30:33 UTC
Description:
When switching dark/light theme while running writer some parts of the UI don't switch colors, leading to very bad contrast. This is fixed by restarting.

Steps to Reproduce:
1. Open writer when light theme is on
2. Switch to dark theme

Actual Results:
See the left part of the attached image

Expected Results:
See the right part of the attached image


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.1.8.1 / LibreOffice Community
Build ID: 10(Build:1)
CPU threads: 12; OS: Linux 5.16; UI render: default; VCL: gtk3
Locale: nl-NL (en_US.UTF-8); UI: en-US
7.1.8-5
Calc: threaded
Comment 1 Dieter 2022-02-21 07:36:20 UTC
Thank you for reporting the bug. It seems you're using an old version of LibreOffice. Could you please try to reproduce it with the latest version of LibreOffice from https://www.libreoffice.org/download/libreoffice-fresh/ ? I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' if the bug is still present in the latest version. Change to RESOLVED WORKSFORME, if the problem went away.
Comment 2 Dieter 2022-03-08 13:21:57 UTC
(In reply to TheStroyer from comment #0)
> Actual Results:
> See the left part of the attached image
> 
> Expected Results:
> See the right part of the attached image

Please attach those images. Thank you.
Comment 3 TheStroyer 2022-03-08 16:55:48 UTC
Created attachment 178727 [details]
Comparison between correct behavior (right) and wrong behavior (left)
Comment 4 TheStroyer 2022-03-08 17:06:58 UTC
A separate thing you can also notice from this picture is that part of the interface, like the font selector disappears. This happens when the window width is made too small. It is present in the >> button on the right. But way more of the interface could be present.
Comment 5 Dieter 2022-03-13 10:43:25 UTC
Just one additional question: Step 2 "Switch to dark theme" is: Tools -> Options -> Personalisation -> Preinstalled theme -> Dark Theme?
Comment 6 TheStroyer 2022-03-13 13:21:40 UTC
No, to switch to dark theme, I switch my gtk theme to a dark variant of the theme. This can be done with the following command:

gsettings set org.gnome.desktop.interface gtk-theme Breeze-Dark

A similar thing can be done to switch to light theme:

gsettings set org.gnome.desktop.interface gtk-theme Breeze

Note that you need to have the breeze theme installed for these commands to work. You can also replace them by Adwaita-dark and Adwaita respectively (capitalization matters).
Comment 7 Caolán McNamara 2022-03-13 19:04:50 UTC
Is it only the muffin/tabbed part of the UI? That's one of the major remaining users of non-native gtk widgets.
Comment 8 TheStroyer 2022-03-13 22:52:02 UTC
There are a couple of other places. When clicking on the dropdown button for font selection, it changes to the wrong color. Also the weird sidebar at the right also has some wrong colors. But the ribbon UI is indeed the worst offender.

I've attached screenshots of the examples. Note that this time I was in dark mode and switched to light mode. So all the dark parts are wrong.
Comment 9 TheStroyer 2022-03-13 22:52:32 UTC
Created attachment 178868 [details]
Font selection
Comment 10 TheStroyer 2022-03-13 22:53:01 UTC
Created attachment 178869 [details]
Side bar
Comment 11 Caolán McNamara 2022-04-15 15:56:38 UTC
https://gerrit.libreoffice.org/c/core/+/133076 should at least fix comment #10 and the "speckles" that can be seen at the corner of the comboboxes in that image.

Comment #9 however I can't reproduce and I'm not sure I'm looking at the right thing. "Default Paragraph Style" and "Clear formatting" looks a bit like the top of the style dropdown from the standard toolbar, but in 7.3 those entries are the other way around and don't have that wide bevel around them
Comment 12 Commit Notification 2022-04-15 18:44:12 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/37fb1cbf7bceac8421741dc55b89146a42a77a22

Related: tdf#147237 change the SalObject background when the settings change

It will be available in 7.4.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 13 Commit Notification 2022-04-19 07:13:48 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

https://git.libreoffice.org/core/commit/7c313b2e41e013d33b3576960a688c319d584d9a

Related: tdf#147237 change the SalObject background when the settings change

It will be available in 7.3.4.

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 14 Stéphane Guillou (stragu) 2023-03-31 14:00:44 UTC
TheStroyer, can you still reproduce comment 9 in versions 7.4 or 7.5 ?
Comment 15 TheStroyer 2023-04-12 14:42:22 UTC
Created attachment 186619 [details]
Bad (sidebar)
Comment 16 TheStroyer 2023-04-12 14:43:13 UTC
No, I cannot reproduce that bug. There are still some elements that don't switch properly. But at least in the default layout (no ribbons) most things seem to switch theme. I did experience the first time I tried switching that the icons didn't switch theme at all, making them invisible. But I cannot reproduce that the second time.

The elements that don't switch are included in screenshots.
Comment 17 TheStroyer 2023-04-12 14:43:32 UTC
Created attachment 186620 [details]
Good (sidebar)
Comment 18 TheStroyer 2023-04-12 14:44:40 UTC
Created attachment 186621 [details]
Bad (completion)

The completion is only readable in light mode (the text doesn't toggle color at all, be it dynamically or otherwise)
Comment 19 TheStroyer 2023-04-12 14:45:00 UTC
Created attachment 186622 [details]
Good (completion)
Comment 20 Stéphane Guillou (stragu) 2023-04-12 17:07:31 UTC
Thank you for testing again, TheStroyer.

I can't reproduce the Word Completion tooltips or the sidebar hamburger icon issues with:

Version: 7.5.2.2 (X86_64) / LibreOffice Community
Build ID: 53bb9681a964705cf672590721dbc85eb4d0c3a2
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

nor with 7.4.6.

Regarding the tabbed interface issue, it should be fixed in 7.5.2. See bug 153541.

If you can consistently reproduce the Word Completion tooltip and sidebar's hamburger icon issues in 7.5, please open new reports about each of them separately.

Given that the main issues are resolved, please go ahead and close as fixed, Caolán.
Comment 21 TheStroyer 2023-04-15 09:20:39 UTC
Thank you for taking a look. The main issue is fixed indeed, so I'll close it.