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

Bug 463127

Summary: [Win32][GTK] Transparent background not honored on Composite with Scrollbars
Product: [Eclipse Project] Platform Reporter: Ian Bull <irbull>
Component: SWTAssignee: Niraj Modi <niraj.modi>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, Lars.Vogel, lufimtse, markus.kell.r, niraj.modi, sravankumarl
Version: 4.5   
Target Milestone: 4.5 M7   
Hardware: PC   
OS: All   
See Also: https://git.eclipse.org/r/45441
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=476b88e18102db1fbb9ef3a7784dd7270d0ecf3b
https://git.eclipse.org/r/45906
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=79d9fccb3fbc773688882f3e7477eaa419d13abb
Whiteboard:
Bug Depends on:    
Bug Blocks: 435384    
Attachments:
Description Flags
Screenshot showing the problem
none
Snippet showing the problem
none
Screenshot: rendering problems in Eclipse toolbars none

Description Ian Bull CLA 2015-03-25 14:55:09 EDT
Created attachment 251907 [details]
Screenshot showing the problem

When a scrolled composite is created with either H_SCROLL or V_SCROLL, the transparent background is ignored. This works fine on MacOS, but not on Windows.

I've attached an image that shows the same snippet on Mac and Windows. On the left, is a scrolled composite created with H_SCROLL | V_SCROLL. On the right is a scrolled composite without these styles. On MacOS, the background bleeds through, but on Windows, the background is just white. 

I will attache the snippet too.
Comment 1 Ian Bull CLA 2015-03-25 14:56:15 EDT
Created attachment 251908 [details]
Snippet showing the problem
Comment 2 Niraj Modi CLA 2015-04-08 04:19:26 EDT
While investigating on this bug, learned that Composite classes with and without scrollbars are intentionally treated differently, below comment explains the reason: https://bugs.eclipse.org/bugs/show_bug.cgi?id=234649#c5

So, THEME_BACKGROUND flag needs to be enabled when COLOR_TRANSPARENT background is set to follow parent's background theme and leading to transparent background.

Having proper THEME_BACKGROUND setting in "Scrollable" class, also enable below children widgets to honor SWT.COLOR_TRANSPARENT flag:
- Composite(ScrolledComposite, Combo, CCombo, TabFolder, Tree, ExpandBar)
- List
- Text
Comment 3 Eclipse Genie CLA 2015-04-08 04:31:24 EDT
New Gerrit change created: https://git.eclipse.org/r/45441
Comment 5 Markus Keller CLA 2015-04-08 13:58:23 EDT
Created attachment 252236 [details]
Screenshot: rendering problems in Eclipse toolbars

(In reply to Eclipse Genie from comment #4)
> Gerrit change https://git.eclipse.org/r/45441 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=476b88e18102db1fbb9ef3a7784dd7270d0ecf3b

This commit causes rendering problems in Eclipse toolbars.
Comment 6 Niraj Modi CLA 2015-04-09 07:41:18 EDT
(In reply to Markus Keller from comment #5)
> Created attachment 252236 [details]
> Screenshot: rendering problems in Eclipse toolbars
> 
> (In reply to Eclipse Genie from comment #4)
> > Gerrit change https://git.eclipse.org/r/45441 was merged to [master].
> > Commit:
> > http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=476b88e18102db1fbb9ef3a7784dd7270d0ecf3b
> 
> This commit causes rendering problems in Eclipse toolbars.

Thanks Markus, for pointing this out.
Resolved this problem via below git commit:
http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=f462669e970460bddf7baab0e5475c20d3df4fdc
Comment 7 Niraj Modi CLA 2015-04-14 05:24:13 EDT
(In reply to Ian Bull from comment #0)
> Created attachment 251907 [details]
> Screenshot showing the problem
> 
> When a scrolled composite is created with either H_SCROLL or V_SCROLL, the
> transparent background is ignored. This works fine on MacOS, but not on
> Windows.

Issue is fixed on Windows, but exists on Linux.. Working on GTK specific patch.
Comment 8 Eclipse Genie CLA 2015-04-16 02:04:57 EDT
New Gerrit change created: https://git.eclipse.org/r/45906
Comment 10 Ian Bull CLA 2015-04-17 01:47:02 EDT
Thanks for all your hard work on this issue. 

I'm still having some problems however. I'm trying to create a 'glass pane' -- that is a composite A that sits above another composite B. Composite A has a transparent background, and my expectation is that the widgets on Composite B will show through. This works on Mac but not windows. I don't know if this is related to the work done here or not. I've filed a new bug to track this (Bug 464842).

Thanks again for all the work on this.
Comment 11 Niraj Modi CLA 2015-04-17 05:42:04 EDT
(In reply to Ian Bull from comment #10)
> Thanks for all your hard work on this issue. 
> 
> I'm still having some problems however. I'm trying to create a 'glass pane'
> -- that is a composite A that sits above another composite B. Composite A
> has a transparent background, and my expectation is that the widgets on
> Composite B will show through. This works on Mac but not windows. I don't
> know if this is related to the work done here or not. I've filed a new bug
> to track this (Bug 464842).
> 
> Thanks again for all the work on this.

Thanks Ian for your quick feedback.. Resolving this now.
Comment 12 Niraj Modi CLA 2015-04-28 07:42:36 EDT
Verified the fix in build: I20150428-0100
Comment 13 Sravan Kumar Lakkimsetti CLA 2015-04-29 02:55:49 EDT
Verified the fix in build: I20150428-0100