Bug 421836 - [GTK3] Some composite now have background
Summary: [GTK3] Some composite now have background
Status: CLOSED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.4   Edit
Hardware: All Linux-GTK
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 340067 441566 494883
  Show dependency tree
 
Reported: 2013-11-15 08:37 EST by Mickael Istria CLA
Modified: 2017-05-17 15:07 EDT (History)
7 users (show)

See Also:
akurtakov: review+


Attachments
Screenshot (58.99 KB, image/jpeg)
2013-11-15 08:37 EST, Mickael Istria CLA
no flags Details
A snippet to reproduce it (using Section) (1.18 KB, text/x-java)
2014-02-17 12:52 EST, Mickael Istria CLA
no flags Details
Always set the background color (hack?) (625 bytes, patch)
2014-05-11 14:24 EDT, Marc-André Laperle CLA
no flags Details | Diff
screenshot from snippet (30.99 KB, image/jpeg)
2014-05-12 06:33 EDT, Mickael Istria CLA
no flags Details
A snippet to reproduce it (using Section) (1.60 KB, text/x-java)
2014-05-12 06:34 EDT, Mickael Istria CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mickael Istria CLA 2013-11-15 08:37:28 EST
Created attachment 237492 [details]
Screenshot

I'm using Luna 4.4.M3 RCP package and libgtk-3.0 version 3.4.2-0ubuntu5.
I noticed when opening the MANIFEST.MF editor that some widgets now show a background. See for instance the background under the general section in screenshot. It used to be white.

Not sure who's culprit: SWT or PDE...
Comment 1 Alexander Kurtakov CLA 2013-12-09 16:54:15 EST
Mickael, can you come with pure swt reproducer?
Comment 2 Mickael Istria CLA 2013-12-10 03:35:47 EST
Sorry, I'm quite busy for the moment. I'll try to find time within a few days. If you don't have news soon, feel free to ping me back.
Comment 3 Mickael Istria CLA 2013-12-10 08:34:51 EST
By the way, the editor relies on the form API, which is another usual suspect.
Comment 4 Robin Stocker CLA 2014-01-07 13:14:34 EST
See also bug 422940, which is about visual artifacts with FormToolkit code.
Comment 5 Alexander Kurtakov CLA 2014-01-07 13:33:21 EST
I don't have much free time so please come with pure swt reproducer to ease people that would probably look at it.
Comment 6 Mickael Istria CLA 2014-02-17 10:32:44 EST
I believe it can be related to bug 421834 about current SWT/GTK3 implementation making children composite inherit some stuff from parents. In this case, it could be a child inheriting the transparency settings from its parent.
Comment 7 Mickael Istria CLA 2014-02-17 12:52:50 EST
Created attachment 240040 [details]
A snippet to reproduce it (using Section)

Here is a snippet that reproduce the bug (or maybe just a part of it). We can see that with GTK3, the child widget containing the description inherits from the color of the title, whereas it's not the case with GTK2.
I tried to dig deeper, but I didn't manage to find out a better way to reproduce this.
Comment 8 Marc-André Laperle CLA 2014-05-11 00:04:45 EDT
(In reply to Mickael Istria from comment #7)
> Created attachment 240040 [details]
> A snippet to reproduce it (using Section)
> 
> Here is a snippet that reproduce the bug (or maybe just a part of it). We
> can see that with GTK3, the child widget containing the description inherits
> from the color of the title, whereas it's not the case with GTK2.
> I tried to dig deeper, but I didn't manage to find out a better way to
> reproduce this.

I don't see the use of Section in this file. Did you attach the right file?
Comment 9 Marc-André Laperle CLA 2014-05-11 14:24:45 EDT
Created attachment 242948 [details]
Always set the background color (hack?)

In Control.setBackground (Color color)

If I change it to always set the color, it looks much better (if (OS.GTK3) set = true;). But it doesn't seem right to always set it.
Comment 10 Mickael Istria CLA 2014-05-12 06:33:15 EDT
Created attachment 242958 [details]
screenshot from snippet

This screenshot shows the difference of behaviour with GTK3 vs GTK2.
Comment 11 Mickael Istria CLA 2014-05-12 06:34:18 EDT
Created attachment 242959 [details]
A snippet to reproduce it (using Section)

Updated reproducer
Comment 12 Alexander Kurtakov CLA 2014-05-12 06:47:36 EDT
(In reply to Marc-Andre Laperle from comment #9)
> Created attachment 242948 [details]
> Always set the background color (hack?)
> 
> In Control.setBackground (Color color)
> 
> If I change it to always set the color, it looks much better (if (OS.GTK3)
> set = true;). But it doesn't seem right to always set it.

Marc, this is a huge hack but I wouldn't mind having it in Luna (with TODO to fix it properly). To give some info - some widgets like GtkLabel(and others) are transparent now, so one needs to set their background. 
Would you please submit a patch about it?
Comment 13 Marc-André Laperle CLA 2014-05-12 11:03:27 EDT
Patch:
https://git.eclipse.org/r/26375
Comment 14 Marc-André Laperle CLA 2014-05-12 11:30:00 EDT
(In reply to Mickael Istria from comment #11)
> Created attachment 242959 [details]
> A snippet to reproduce it (using Section)
> 
> Updated reproducer

Thanks Mickael!
Comment 15 Arun Thondapu CLA 2014-05-13 03:59:47 EDT
(In reply to Marc-Andre Laperle from comment #13)
> Patch:
> https://git.eclipse.org/r/26375

Pushed the patch to master - http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=2247f34f7e6717b23f83a3e524d9181bdd001eaf

Lets keep the bug open to investigate a proper fix...
Comment 16 Snjezana Peco CLA 2015-08-27 09:03:08 EDT
I can't reproduce the issue on Mars.
Comment 17 Alexander Kurtakov CLA 2016-04-15 13:01:30 EDT
Eric, would you please take a look what/if anything needs work on this bug still?
Comment 18 Eric Williams CLA 2016-04-15 14:32:51 EDT
(In reply to Alexander Kurtakov from comment #17)
> Eric, would you please take a look what/if anything needs work on this bug
> still?

Yes this is still needed, unfortunately. If I remove it I get blue backgrounds in the manifest editor.
Comment 19 Eric Williams CLA 2016-04-22 11:49:34 EDT
I think the cause of this bug is somewhat natural for GTK3. Certain widgets have elements that contain multiple elements. For example a GtkLabel has a GtkBox, and an SwtFixed container. 

These containers may not explicitly have backgrounds set. Setting a background color higher up in the widget tree might cause these containers to inherit this background. This causes some weird areas to have background colors where others don't. 

For example, look at the manifest editor. The blue spots are interspersed in odd places that don't seem to match up to a specific widget. My guess here is that these are overlapping containers, where the top one has no background color and the bottom one does. The top container inherits the blue color from elsewhere, and the bottom container has a white background. The portions of the top container that are not covered by the bottom container are therefore blue.

Since we use SwtFixed containers in GTK3 for just about everything, setting the background color on all of them for a consistent color scheme might be necessary.
Comment 20 Alexander Kurtakov CLA 2016-05-10 05:50:03 EDT
I feel it's time to close this bug. Many things have changed since it was filed and it's a big vague. Better to have dedicated bugs for any other known bug.
Comment 21 Alexander Kurtakov CLA 2016-07-28 09:53:17 EDT
Closing.