Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 493036

Summary: [GTK3] Tabs within an editor have bad background (EGerrit)
Product: [Eclipse Project] Platform Reporter: Marc-André Laperle <malaperle>
Component: SWTAssignee: Eric Williams <ericwill>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: akurtakov, arunkumar.thondapu, ericwill, pascal, patrick.pollo.guilbert
Version: 4.6Flags: akurtakov: review+
Target Milestone: 4.6 RC1   
Hardware: PC   
OS: Linux   
See Also: https://git.eclipse.org/r/72160
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=e02ee8bc32f264213b60930165dc7d9aa7e2e7ae
Whiteboard:
Bug Depends on:    
Bug Blocks: 474628    
Attachments:
Description Flags
Screen shot
none
TabFolder example screenshot none

Description Marc-André Laperle CLA 2016-05-04 18:33:18 EDT
Created attachment 261474 [details]
Screen shot

Eclipse 4.6.0.I20160504-0035
Using EGerrit 0.3.0.468
Fedora 23 (GTK 3.18.9)

1. Open a Gerrit review from the Gerrit Dashboard (EGerrit)
2. The tabs at the top of the review (History, Messages, Details) look wrong and have odd background.

See attached screen shot. This looks normal under GTK2.
Comment 1 Eric Williams CLA 2016-05-05 10:08:15 EDT
I will investigate.
Comment 2 Eclipse Genie CLA 2016-05-05 13:51:25 EDT
New Gerrit change created: https://git.eclipse.org/r/72160
Comment 3 Marc-André Laperle CLA 2016-05-06 14:59:16 EDT
Created attachment 261523 [details]
TabFolder example screenshot

Screen shot of Tab Folder example after patch
Comment 4 Eric Williams CLA 2016-05-09 08:57:05 EDT
I upgraded my EGerrit to 0.3.0.476 (from nightly) and I can see my patch doesn't fix the issue on GTK3.18. GTK3.20+ seems fine, very strange. I will investigate.
Comment 5 Marc-André Laperle CLA 2016-05-09 11:27:39 EDT
>    String name = OS.GTK_VERSION >= OS.VERSION(3, 20, 0) ? "notebook header" : "GtkNotebook.header";

Eric, I think we need a way to mitigate those issues of the CSS changing. There are been several bugs related to this kind of change. I am thinking of bringing this up to the GTK developers. IMO, removing or renaming things in the CSS is an "API" breaking change: it breaks applications that use the CSS directly, like SWT and also non-Adwaita themes. I understand that bumping the major number of GTK is impractical so the other options are to either not break the CSS or to methodically document the changes (think Migration guide) and include them in the release notes. I doubt GTK will be receptive to not breaking the CSS so I think documentation is the way to go. I'm bringing this up here first in case you have a different opinion from a SWT perspective.
Comment 6 Eric Williams CLA 2016-05-09 11:53:31 EDT
(In reply to Marc-Andre Laperle from comment #5)
> >    String name = OS.GTK_VERSION >= OS.VERSION(3, 20, 0) ? "notebook header" : "GtkNotebook.header";
> 
> Eric, I think we need a way to mitigate those issues of the CSS changing.
> There are been several bugs related to this kind of change. I am thinking of
> bringing this up to the GTK developers. IMO, removing or renaming things in
> the CSS is an "API" breaking change: it breaks applications that use the CSS
> directly, like SWT and also non-Adwaita themes. I understand that bumping
> the major number of GTK is impractical so the other options are to either
> not break the CSS or to methodically document the changes (think Migration
> guide) and include them in the release notes. I doubt GTK will be receptive
> to not breaking the CSS so I think documentation is the way to go. I'm
> bringing this up here first in case you have a different opinion from a SWT
> perspective.

Someone has already raised this with the GTK devs here is a short summary of the outcome:

-GTK3.20 and below CSS was never "API" in a strict sense so the GTK devs didn't feel the need to support the exact format of it (for example things like the selectors, were subject to change)

-GTK3.20 has CSS as an API, and the GTK team has stated that this API is "stable", essentially after GTK3.20 the CSS API for 3.20+ is guaranteed to work. If you look at the documentation for GTK, every widget now has a CSS section.

I know it's a bit of a pain from GTK3.18 -> GTK3.20, but after 3.20 things are guaranteed to stay a lot more stable than previously.
Comment 7 Marc-André Laperle CLA 2016-05-09 13:12:17 EDT
(In reply to Eric Williams from comment #6)
> -GTK3.20 has CSS as an API, and the GTK team has stated that this API is
> "stable", essentially after GTK3.20 the CSS API for 3.20+ is guaranteed to
> work. If you look at the documentation for GTK, every widget now has a CSS
> section.

That sounds great! Thanks for the clarification!
Comment 9 Arun Thondapu CLA 2016-05-09 13:43:37 EDT
Pushed to master.