Bug 92776 - UI: Tab names unreadable in GTK3 in Ubuntu
Summary: UI: Tab names unreadable in GTK3 in Ubuntu
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
5.1.0.0.alpha0+ Master
Hardware: Other All
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:5.3.0 target:5.2.4
Keywords:
: 96715 97793 102258 (view as bug list)
Depends on:
Blocks: GTK3
  Show dependency treegraph
 
Reported: 2015-07-15 21:26 UTC by Luke
Modified: 2016-11-24 12:04 UTC (History)
10 users (show)

See Also:
Crash report or crash signature:


Attachments
gtk2 vs gtk3 in Ubuntu 15.4 (256.28 KB, image/png)
2015-07-15 21:27 UTC, Luke
Details
LibreOffice 5.2.2 runs from snap on Ubuntu 16.04 (48.42 KB, image/png)
2016-10-11 15:47 UTC, Björn Michaelsen
Details
vendor-patched LibreOffice 5.2.2 run on Ubuntu 16.10 (gtk+3.0 3.20) (51.96 KB, image/png)
2016-10-11 16:00 UTC, Björn Michaelsen
Details
standalone get label text color in a notebook tab (4.81 KB, text/plain)
2016-11-15 09:30 UTC, Caolán McNamara
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luke 2015-07-15 21:26:50 UTC
Steps to reproduce:

1. With a recent build of LO 5.1 launch it with $ SAL_USE_VCLPLUGIN=gtk soffice
2. Open a tabbed Dialog box such Format->Paragraph
3. Do the same with $ SAL_USE_VCLPLUGIN=gtk3 soffice

Note the text in gtk3 is white on light gray, which is very hard to read.
Comment 1 Luke 2015-07-15 21:27:56 UTC
Created attachment 117266 [details]
gtk2 vs gtk3 in Ubuntu 15.4
Comment 2 Adolfo Jayme Barrientos 2015-07-16 11:48:03 UTC
→ NEW
Comment 3 Luke 2015-07-26 07:18:14 UTC
I can confirm reverting 
http://cgit.freedesktop.org/libreoffice/core/commit/?id=031a347668e56c1b38c0539d30e9a1cbb808ca02
resolves this issue. With GTK3 the tabs are using the theme's font color but not background color. 

Caolán,
Would it be possible to use the background color too? If not, reverting to the none-themed tabs would be better than the current situation.
Comment 4 Caolán McNamara 2015-08-07 09:06:05 UTC
regression is misleading in this context
Comment 5 Luke 2015-08-09 11:30:48 UTC
Björn,
If this doesn't get fixed before 5.1 makes it into Ubuntu, you'll want to force GTK2.
Comment 6 Luke 2015-08-29 06:33:06 UTC
Maxim is working on theme consistency issues. See Bug 93558
Comment 7 Luke 2015-10-16 20:51:36 UTC
This is not a dark theme/light theme issue. Both Ubuntu's dark theme Ambiance and light theme Radiance have the same issue. In Debian Jessie, when you use the tweak-tool to change to a dark theme, it correctly changes the tab color in LibreOffice.

Another difference between Debian's Dark theme and Ubuntu's, is that the dark them in Debian also changes the sidebar. However unlike the tabs, the sidebar uses the correct uses black text. 

Maxim or Björn,
It seems that Ubuntu's theme information is incomplete. Should a launchpad bug be filed? In any case, we need to emulate the sidebar's fall-back behavior. If you can't read the background color, don't change the font color.
Comment 8 Maxim Monastirsky 2015-12-24 22:21:25 UTC
*** Bug 96715 has been marked as a duplicate of this bug. ***
Comment 9 Maxim Monastirsky 2016-02-12 11:39:17 UTC
*** Bug 97793 has been marked as a duplicate of this bug. ***
Comment 10 Doctor Rover 2016-03-18 17:13:48 UTC
There are two more issues on Ubuntu associated with gtk2-vs-gtk3 behavior.
First is missing global menu and HUD in gtk3. Nonoperability of the global menu is clearly seen in the screenshot attached to this bug report.
The other is broken scrollbars. It is not seen on the screenshot, but the current state is that the slider within the modern gtk3-style scrollbars fills the area of the scrollbar with its color as it moves just like a paint brush.
I don't know if these issues can be considered as part of this bug or should be considered as separate bugs?

Ubuntu 15.10 x64
LibreOffice 5.1.1.2 (1:5.1.1~rc2-0ubuntu1~wily0) installed from ppa:libreoffice/ppa
Comment 11 Luke 2016-03-18 21:56:49 UTC
Doctor Rover,
Thank you for your input, but please do not treat the bug tracker like a discussion forum. See 

https://wiki.documentfoundation.org/QA/BugReport#One_Report.2C_Five_Bugs 

"One report should only have a single bug in it. Developers are unlikely to take on a bug that has multiple issues listed." Please do not add noise here. If you want to help, file clear concise bug reports and link them with the "See Also".
Comment 12 Adolfo Jayme Barrientos 2016-09-19 02:38:06 UTC
*** Bug 102258 has been marked as a duplicate of this bug. ***
Comment 13 Björn Michaelsen 2016-10-11 15:42:38 UTC
Vendor-patched on Ubuntu 16.10 with:

 https://git.launchpad.net/~libreoffice/ubuntu/+source/libreoffice/commit/?h=ubuntu-yakkety-5.2&id=6808808925f82839fd7f2bbfead4ddfa3081619b

Ubuntu 16.10 uses gtk+3.0 3.20.9-1ubuntu2.

Curiously, this does _not_ happen with the LibreOffice snap builds running on Xenial snap base and a Xenial host -- thus both using gtk+3.0 at 3.18.9-1ubuntu3.1.
Comment 14 Björn Michaelsen 2016-10-11 15:47:30 UTC
Created attachment 127947 [details]
LibreOffice 5.2.2 runs from snap on Ubuntu 16.04
Comment 15 Björn Michaelsen 2016-10-11 16:00:56 UTC
Created attachment 127948 [details]
vendor-patched LibreOffice 5.2.2 run on Ubuntu 16.10 (gtk+3.0 3.20)

(Adding screenshot of LibreOffice 5.2.2 with vendor-patch from comment 13, without the patch it looks white-on-white as per attachment 117266 [details].

This suggests the theming is ok with 3.18, but broke with 3.20 -- either because of the theme, because of gtk3 itself or because of our gtk3 implementation in LibreOffice when build against 3.20.
Comment 16 Commit Notification 2016-10-12 20:20:43 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=570669631359021a8ad420753c87bcf4419d06cd

Related: tdf#92776 set parent style of notebook to toplevel window style

It will be available in 5.3.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 17 Caolán McNamara 2016-10-12 20:23:05 UTC
caolanm->bjoern: Can you check if this fixes the problem for you.
Comment 18 Björn Michaelsen 2016-10-14 23:43:36 UTC
(In reply to Caolán McNamara from comment #17)
> caolanm->bjoern: Can you check if this fixes the problem for you.

Backported the fix to 5.2 to test and the fix solves the issue. Thank you so much for digging into this!

Marking this RESOLVED/FIXED, setting as assignee (along with kudos and credit) to Caolan, as he fixed this.
Comment 19 Commit Notification 2016-10-17 19:59:03 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=69c9acd4b8dcd7ec8a5c3c380ad5cd8b797661ea

Resolves: tdf#92776 ensure correct notebook tab font color

It will be available in 5.3.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 20 Jean-Baptiste Faure 2016-10-19 04:44:47 UTC
Thank you very much Caolán for this fix. It works for me in the master under Ubuntu 16.04 x86-64. Do you plan to backport the fix to 5.2 branch ?

Best regards. JBF
Comment 21 Jean-Baptiste Faure 2016-11-08 19:39:47 UTC
Problem is back: with the current master built at home under Ubuntu 16.10 x86-64, I get the same result as in first screen copy: https://bugs.documentfoundation.org/attachment.cgi?id=117266

Best regards. JBF
Comment 22 Caolán McNamara 2016-11-15 09:28:14 UTC
Ubuntu 16.10 is using gtk3 3.20 which has a different theming system in practice than the earlier gtk3 of Ubuntu 16.04. Oddly gtk3 3.20 is the version we use in Fedora 24 and has the "new" theming system which is better documented, so its odd that this isn't working right, and I can't see why. I'll attach a standalone program which reproduces the problem.
Comment 23 Caolán McNamara 2016-11-15 09:30:49 UTC
Created attachment 128758 [details]
standalone get label text color in a notebook tab

this is supposed to get the label text color in a notebook tab, see comment at to of tabcolor.c to compile
Comment 24 Commit Notification 2016-11-16 21:18:02 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=567580bddfa7b3d437b072698de77968c6513513

Resolves: tdf#92776 tab names unreadable under Ambiance theme 3.20

It will be available in 5.3.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 25 Jean-Baptiste Faure 2016-11-17 05:44:11 UTC
(In reply to Commit Notification from comment #24)
> Caolán McNamara committed a patch related to this issue.
> It has been pushed to "master":
> 
> http://cgit.freedesktop.org/libreoffice/core/commit/
> ?id=567580bddfa7b3d437b072698de77968c6513513
> 
> Resolves: tdf#92776 tab names unreadable under Ambiance theme 3.20
> [...]
> Affected users are encouraged to test the fix and report feedback.

Now it works as expected!
Tested in my own build of Version: 5.3.0.0.alpha1+
Build ID: 234325b9fc0d54e594de8e5d2e7c717684db1745
Threads CPU : 4; Version de l'OS :Linux 4.8; UI Render : par défaut; VCL: gtk3; Layout Engine: new; 
Ubuntu_16.10_x86-64
Locale : fr-FR (fr_FR.UTF-8); Calc: group

Thank you very much. Closing as fixed again.

Best regards. JBF
Comment 26 Commit Notification 2016-11-24 12:04:34 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-5-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=83dc2227f35795aee4e2ccaccbb7d67d4c50ba3f&h=libreoffice-5-2

Resolves: tdf#92776 backport gtk3 >= 3.20 themeing improvements

It will be available in 5.2.4.

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.