Bug 102909 - VCL gtk3 menubar not themed
Summary: VCL gtk3 menubar not themed
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
5.2.2.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:6.0.0
Keywords:
Depends on:
Blocks: GTK3
  Show dependency treegraph
 
Reported: 2016-10-01 09:02 UTC by Hanno Meyer-Thurow
Modified: 2017-07-26 14:02 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hanno Meyer-Thurow 2016-10-01 09:02:53 UTC
Caolan, did a great job, but one detail about the menubar gtk_style_context, even commented in sourcecode[0], goes wrong on Fedora, I guess. Simply because I have to do it the right way, see [0].

I have to use 'context = mpMenuBarStyle;' to get my Gentoo MATE GTK3 Green-Submarine theme on the menubar.


[0] https://cgit.freedesktop.org/libreoffice/core/tree/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx#n1387
Comment 1 Hanno Meyer-Thurow 2016-10-01 09:43:30 UTC
See mate-themes bugreport for a video demonstrating current unpatched state:
https://github.com/mate-desktop/mate-themes/issues/142
Comment 2 Maxim Monastirsky 2016-10-02 09:53:11 UTC
Since 5.2 we use real gtk menubar widget, so I doubt this theming code has any effect nowadays.

(And despite what was said in the github ticket, gtk 3.20 is perfectly supported in LO for a long time. One only need to make sure to compile against gtk 3.20. LO compiled against 3.18 won't have correct theming with 3.20.)
Comment 3 Hanno Meyer-Thurow 2016-10-02 18:51:06 UTC
Well, Gentoo builds from source and I know I build against gtk+3.20.x.

And if you had looked at the source you would be enlightened. It is the native gtk+3.20 themeing introduced by Caolon McNamara in February. And he especially disabled native menubar themeing for no known reason other than "it does not work for him on Fedora".
Comment 4 Maxim Monastirsky 2016-10-04 17:56:40 UTC
(In reply to Hanno Meyer-Thurow from comment #3)
> Well, Gentoo builds from source and I know I build against gtk+3.20.x.
Yes. I was talking about the other comments in github (e.g. Debian).

> And if you had looked at the source you would be enlightened.
For some reason you ignored the first part of my comment:

> Since 5.2 we use real gtk menubar widget, so I doubt this theming code has
> any effect nowadays.

That is, starting with upstream 5.2 (and backported to Fedora's 5.1) the menubar is handled completely by gtk, thus the menu theme code you mention is *unused*.
Comment 5 Caolán McNamara 2016-10-13 12:30:25 UTC
The menubar is a native gtk3 menubar now in 5.2 onwards, so can be considered fixed in 5.2
Comment 6 Hanno Meyer-Thurow 2017-04-09 11:37:06 UTC
Well, as seen in "version affected" it was 5.2.2.2.
I just reproduced this with 5.3.2.2. Therefore, still valid.

The menubar has still light grey text on light grey background.
Applying my PATCH solves this.

Yes, I know Fedora cannot reproduce this bug. Had you looked at the MATE issue I linked to, the theme developer for MATE uses Fedora and he cannot reproduce the bug.

So, if the code I patch is not used, a.k.a. dead code, how could it affect my build to show the menubar properly?! And only if my PATCH is applied. ;-)
I'd like to hear that explanation.

The interesting question still stands.
What does Fedora do differently than vanilla WRT Gtk3 themeing.

I did not see any Fedora PATCH to LibreOffice, which may influence Gtk3 themeing - the last time I checked. The Gtk3 Green-Submarine theme of MATE is the same for the theme developer for MATE. Leaves just the Fedora Gtk3 core theme code/style, which overrides.

Just to have another reference where the same menubar themeing issue manifests:
https://github.com/horst3180/arc-theme/issues/625


Well, in the end, each mixed Gtk3 theme with dark menubar color and light window/dialog(base?) color needs a special entry for LibreOffice - outside of Fedora universe.

The question is, which entry to show it properly since my simple one-liner fix is rejected.

Just a thought: If Fedora shows something bogus with the correct style, you may look at what Fedora does differently than vanilla WRT Gtk3 core themeing. ;-)


Kind regards
Comment 7 Xisco Faulí 2017-06-26 18:52:40 UTC Comment hidden (obsolete)
Comment 8 Caolán McNamara 2017-07-25 13:27:52 UTC
Seeing as the native menubar is *supposed* to be in use for gtk3 and the report that changing the context does something then it might be that the native menubar is somehow disabled, which I think could only happen if built without dbus or without gio support. Maybe that's what's going on on here and we should just remove the weird configure path that would allow that to happen
Comment 9 Commit Notification 2017-07-25 13:29:29 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=0cbbdac4382a36dd8e2c602d239d394eff67c06b

Related: tdf#102909 use menubar style for non-native menubars

It will be available in 6.0.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 10 Caolán McNamara 2017-07-25 14:32:17 UTC
I've committed the themeing change seeing as it makes no odds to the normal config  that shouldn't use it and in a follow up make it impossible to end up with a half-right gtk3 vclplug
Comment 11 Commit Notification 2017-07-26 14:02:35 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=9e043feb59a082f383f757972ee0b1887f8747bc

Related: tdf#102909 gtk3: remove configure loophole of non-native menubar

It will be available in 6.0.0.

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

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