Bug 127583 - In "Tabbed" or "Grouped Compact" toolbar modes, switching between light and dark GTK themes does not refresh the styling of the toolbars
Summary: In "Tabbed" or "Grouped Compact" toolbar modes, switching between light and d...
Status: RESOLVED DUPLICATE of bug 153541
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
6.2.7.1 release
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: UI-Theming Desktop-Integration Notebookbar-Theming Linux-Dark-Mode
  Show dependency treegraph
 
Reported: 2019-09-16 20:19 UTC by Jeff Fortin Tam
Modified: 2023-02-14 13:20 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
light to dark (47.88 KB, image/png)
2019-09-16 20:21 UTC, Jeff Fortin Tam
Details
dark to light (57.82 KB, image/png)
2019-09-16 20:21 UTC, Jeff Fortin Tam
Details
GNOME from light to dark in tabbed UI, LO 7.3 alpha0+ (58.91 KB, image/png)
2021-08-01 14:31 UTC, Stéphane Guillou (stragu)
Details
GNOME from dark to light in groupedbar compact UI, LO 7.3 alpha0+ (51.10 KB, image/png)
2021-08-01 14:32 UTC, Stéphane Guillou (stragu)
Details
Tabbed toolbars behavior in 7.5.0.3 when switching from light to dark, and when forcing a toolbar refresh (162.31 KB, image/png)
2023-02-13 16:14 UTC, Jeff Fortin Tam
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff Fortin Tam 2019-09-16 20:19:34 UTC
Description:
In "Tabbed" or "Grouped Compact" toolbar modes, switching between light and dark GTK theme (Adwaita) does not refresh the styling of the toolbars.

Starting a new window or changing the toolbar style works around the issue.

Steps to Reproduce:
1. Set LibreOffice's toolbar UI to either "Tabbed" or "Grouped Compact"
2. Open gnome-tweak-tool
3. While a LibreOffice Writer/Calc/etc. GUI is open, switch the GTK theme from "Adwaita Dark" to "Adwaita", or from "Adwaita" to "Adwaita Dark".

Actual Results:
The GUI adapts to the new theme, except the main toolbar. Particularly, the combobox/dropdown widgets change their font color but not the widget's background color, leading to illegible text. 

Expected Results:
The main toolbar should adapt, like the rest.


Reproducible: Always


User Profile Reset: Yes



Additional Info:
See attached screenshots.
Tested on Fedora 30 (the latest stable Fedora version available to me), hence the LibreOffice 6.2.x version.
Comment 1 Jeff Fortin Tam 2019-09-16 20:21:24 UTC
Created attachment 154202 [details]
light to dark

When the app was started with the light theme
Comment 2 Jeff Fortin Tam 2019-09-16 20:21:53 UTC
Created attachment 154203 [details]
dark to light

When the app was started with the dark theme
Comment 3 Heiko Tietze 2019-10-05 08:31:03 UTC
Ordinary bug, please fix it.
Comment 4 Stéphane Guillou (stragu) 2021-08-01 14:30:23 UTC
Reproduced with recent master build, using the GNOME 3.36 light and dark modes (in GNOME settings > Appearance). Both "Tabbed" and "Groupedbar compact" UIs are affected.

Version: 7.3.0.0.alpha0+ / LibreOffice Community
Build ID: 1dd4a80fa076bedb3a82821517036bad8dd79857
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2021-07-26_22:41:19
Calc: threaded
Comment 5 Stéphane Guillou (stragu) 2021-08-01 14:31:30 UTC
Created attachment 174015 [details]
GNOME from light to dark in tabbed UI, LO 7.3 alpha0+
Comment 6 Stéphane Guillou (stragu) 2021-08-01 14:32:30 UTC
Created attachment 174016 [details]
GNOME from dark to light in groupedbar compact UI, LO 7.3 alpha0+
Comment 7 Jeff Fortin Tam 2022-03-20 19:39:56 UTC
It may now be easier for the app to handle this, as there now is a standardized (i.e. FreeDesktop) way for LibreOffice to authoritatively know, without just trying to "guess" whether the current GTK theme is dark or not, what the user's intent is in terms of light/dark themes.

* Overview here: https://blogs.gnome.org/alexm/2021/10/04/dark-style-preference/
* Implementation tips here: https://gitlab.gnome.org/GNOME/Initiatives/-/wikis/Dark-Style-Preference

Presumably this would let LibreOffice connect to a clear standardized signal, which would allow it to confidently switch over (& refresh) its themes internally when needed.
Comment 8 Jeff Fortin Tam 2023-02-03 14:58:17 UTC
After seeing https://caolanm.blogspot.com/2022/05/dark-style-preference-with-gtk.html I was eagerly awaiting LibreOffice 7.5, presuming that this would be fixed, but it seems this particular issue here (and bug #127138, for the icons, and possibly others related to bug #143344) was not included/taken into account as part of the implementation, as I'm still seeing the same behavior on the version available from Flathub:

Version: 7.5.0.3 (X86_64) / LibreOffice Community
Build ID: c21113d003cd3efa8c53188764377a8272d9d6de
CPU threads: 8; OS: Linux 6.1; UI render: default; VCL: gtk3
Flatpak

GNOME 43 makes it easier to test than before, as you can simply toggle global dark mode on and off at any time from the system menu in the corner of the screen, so you can check how LibreOffice behaves with the transition.

It works for the "Standard toolbar" UI layout (and it even seems to automatically switch the icon theme there?!), but not for "Tabbed", "Tabbed compact" or "Groupedbar compact".

I wonder if the implementation in 7.5 makes it simple enough to address as part of a point release within that series (maybe as an "easyHack"?), or if this will require a whole major release cycle.
Comment 9 Caolán McNamara 2023-02-03 16:05:35 UTC
The TabBar/muffin/ribbon thing doesn't use "real" gtk widgets so it doesn't behave out of the box like the rest
Comment 10 Jeff Fortin Tam 2023-02-13 16:14:27 UTC
Created attachment 185355 [details]
Tabbed toolbars behavior in 7.5.0.3 when switching from light to dark, and when forcing a toolbar refresh

@Caolán:
Oh, that might explains some things... Though, have a look at this new screenshot here, and consider this naïve question of mine: it seems like the "tabbed" toolbars, as well as the "groupedbar compact", in version 7.5, do render 100% correctly (which wasn't the case before) "when the toolbars are rendered/initialized" (i.e. by switching toolbar UI layout modes) _after_ the dark/light switch has occurred... in other words, it appears to that it simply doesn't do that forced refresh upon dark/light switch.

So my thinking is, and maybe this will sound ridiculous: would it make sense for your code (upon live dark/light switch event) to call the same kind of method that is called when the user manually switches between toolbar UI layouts (which leads to the 3rd result, at the bottom of my newest attached screenshot here, which looks fine in 7.5.x), or is that a really nasty incorrect approach?

Just a random idea in case it can be useful :)
Comment 11 Caolán McNamara 2023-02-14 13:20:10 UTC
finally managed to carve out a little time to look at the notebookbar, it wasn't getting any of the existing Settings update notifications due to the non-standard way its wedged into the hierarchy. Its possible that my up and coming fix won't solve everything but should put things on the right path at least.

*** This bug has been marked as a duplicate of bug 153541 ***