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

Bug 468208

Summary: [GTK3] Background not painted correctly when using SWT.EraseItem
Product: [Eclipse Project] Platform Reporter: Bernd Hufmann <bernd.hufmann>
Component: SWTAssignee: Sravan Kumar Lakkimsetti <sravankumarl>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: P3 CC: adietish, arunkumar.thondapu, bernd.hufmann, lshanmug, malaperle, niraj.modi, peter, snjezana.peco, sravankumarl
Version: 4.5Flags: arunkumar.thondapu: review+
Target Milestone: 4.5.1   
Hardware: PC   
OS: Linux   
See Also: https://git.eclipse.org/r/48708
https://git.eclipse.org/r/53548
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=292196c4f29d5ffc8c6ae5f731cf6d40723a6ba1
Whiteboard:
Bug Depends on:    
Bug Blocks: 441566, 474628    
Attachments:
Description Flags
Example none

Description Bernd Hufmann CLA 2015-05-25 14:17:41 EDT
Using the Mars RC2a (and earlier) build, the table background of a table item is not fully drawn when using GTK3 on Linux and using a SWT.EraseItem listener. Using GTK2 it works fine. 

It seems that when the content is painted afterwards it draws over the background. For each column only on very left the background color is visible that was painted in the SWT.EraseItem listener.

I'll upload an example to demonstrate the problem.
Comment 1 Bernd Hufmann CLA 2015-05-25 14:20:30 EDT
Execution environment:
I'm running Ubuntu 14.04 with GTK3 version 3.10.8.
Comment 2 Bernd Hufmann CLA 2015-05-25 14:23:24 EDT
Created attachment 253737 [details]
Example

Example application to demonstrate the bug.

1) Import the Eclipse plug-in to workspace
2) run TableShellExample as Java Application

Run it as GTK2 and then GTK3.

In the GTK2 the whole row has green background. GTK3 only the very left of each column has the green background.
Comment 3 Marc-André Laperle CLA 2015-05-25 15:04:45 EDT
Bernd, could you try with M7? It could be related to the fix for bug 438505.
Comment 4 Bernd Hufmann CLA 2015-05-25 16:17:41 EDT
(In reply to Marc-Andre Laperle from comment #3)
> Bernd, could you try with M7? It could be related to the fix for bug 438505.

Thanks Marc-Andre. 

M7 has the same issue.
Comment 5 Bernd Hufmann CLA 2015-05-26 13:08:51 EDT
Increased importance. Trace Compass uses the SWT.EraseItem listener for special highlighting in a table and it's an important feature for the application.
Comment 6 Snjezana Peco CLA 2015-05-26 16:20:43 EDT
(In reply to Bernd Hufmann from comment #4)
> (In reply to Marc-Andre Laperle from comment #3)
> > Bernd, could you try with M7? It could be related to the fix for bug 438505.
> 
> Thanks Marc-Andre. 
> 
> M7 has the same issue.

The issue can be reproduced in GTK >= 3.10 and any Eclipse distribution.
Comment 7 Eclipse Genie CLA 2015-05-27 02:26:20 EDT
New Gerrit change created: https://git.eclipse.org/r/48708
Comment 8 Sravan Kumar Lakkimsetti CLA 2015-05-27 02:27:34 EDT
(In reply to Snjezana Peco from comment #6)
> (In reply to Bernd Hufmann from comment #4)
> > (In reply to Marc-Andre Laperle from comment #3)
> > > Bernd, could you try with M7? It could be related to the fix for bug 438505.
> > 
> > Thanks Marc-Andre. 
> > 
> > M7 has the same issue.
> 
> The issue can be reproduced in GTK >= 3.10 and any Eclipse distribution.

please have a look at the patch at https://git.eclipse.org/r/48708. This change helps in fixing the problem but I think we need to think for a better fix
Comment 9 Niraj Modi CLA 2015-05-27 03:31:28 EDT
It seems below workaround-fix for bug 459117 in 4.5M7 has introduced this problem:
http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=a448e5fba612fd4d50d640de1bf1837494976dba

If we don't reach a proper fix for this bug, should we consider reverting above patch ?
Comment 10 Sravan Kumar Lakkimsetti CLA 2015-05-27 04:09:15 EDT
(In reply to Niraj Modi from comment #9)
> It seems below workaround-fix for bug 459117 in 4.5M7 has introduced this
> problem:
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> ?id=a448e5fba612fd4d50d640de1bf1837494976dba
> 
> If we don't reach a proper fix for this bug, should we consider reverting
> above patch ?

I think reverting will introduce a bigger problem here. The leaking text won't look nice. 

In my opinion reverting the code fix for leaking text is bigger evil than this problem
Comment 11 Sravan Kumar Lakkimsetti CLA 2015-05-27 08:51:48 EDT
This is very late for 4.5 release. can we triage this for 4.5.1?
Comment 12 Snjezana Peco CLA 2015-05-27 10:58:26 EDT
(In reply to Sravan Kumar Lakkimsetti from comment #10)
> 
> I think reverting will introduce a bigger problem here. The leaking text
> won't look nice. 
> 
> In my opinion reverting the code fix for leaking text is bigger evil than
> this problem

Agree. 
https://git.eclipse.org/r/48708 fixes the issue.
Since the issue can't be reproduced on GTK>=3.14, the patch (as well as the workaround for bug 459117) isn't necessary for those GTK versions.
Comment 13 Bernd Hufmann CLA 2015-05-27 11:06:05 EDT
Thanks for looking into this.

I would appreciate if it could be part of 4.5. 

A central feature of Trace Compass would not be working well with GTK3 and we would need to suggest to the users to switch to GTK2.

I'd like to test the patch. But I'm not able to run the code using the patch because I haven't figured out how to run it from source code. 

Any instructions for that? 

Thanks
Bernd
Comment 14 Snjezana Peco CLA 2015-05-27 12:44:13 EDT
(In reply to Bernd Hufmann from comment #13)
> Thanks for looking into this.
> 
> I would appreciate if it could be part of 4.5. 
> 
> A central feature of Trace Compass would not be working well with GTK3 and
> we would need to suggest to the users to switch to GTK2.
> 
> I'd like to test the patch. But I'm not able to run the code using the patch
> because I haven't figured out how to run it from source code. 
> 
> Any instructions for that? 
> 
> Thanks
> Bernd


See http://www.eclipse.org/swt/git.php
Comment 15 Bernd Hufmann CLA 2015-05-27 15:48:42 EDT
(In reply to Snjezana Peco from comment #14)
> See http://www.eclipse.org/swt/git.php
Thanks!

I tried the fix for the table and it works. It looks good for Trace Compass.

I don't have a test case for the tree though.

Are you going to merge that for 4.5?
Comment 16 Sravan Kumar Lakkimsetti CLA 2015-05-28 04:57:21 EDT
(In reply to Bernd Hufmann from comment #15)
> (In reply to Snjezana Peco from comment #14)
> > See http://www.eclipse.org/swt/git.php
> Thanks!
> 
> I tried the fix for the table and it works. It looks good for Trace Compass.
> 
> I don't have a test case for the tree though.
> 
> Are you going to merge that for 4.5?

This patch fixes only the usecase mentioned in this bug. It doesn't completely fix the problem. We are inclined to put this in SR1 timeframe. Also we feel this is very risky to do this
Comment 17 Sravan Kumar Lakkimsetti CLA 2015-05-28 04:58:22 EDT
Since this bug fix is quite risky I am suggesting it to triage to 4.5.1
Comment 18 Bernd Hufmann CLA 2015-05-28 10:39:39 EDT
(In reply to Sravan Kumar Lakkimsetti from comment #17)
> Since this bug fix is quite risky I am suggesting it to triage to 4.5.1

From my point of view it would great if a fix would be available for 4.5.

Having said that, you know the source code better than me and you have to decide what is the right thing to do. We definitely don't want to break other things with this late patch.

Thanks
Bernd
Comment 19 Arun Thondapu CLA 2015-08-11 07:26:11 EDT
Fixed in master, will leave the bug open for backporting to 4.5.1.
Comment 20 Sravan Kumar Lakkimsetti CLA 2015-08-12 06:10:46 EDT
I have tested it using Ubuntu 14.04(gtk 3.10.8) and Kubuntu 15.05(gtk 3.14.13) found no issues.
Comment 21 Arun Thondapu CLA 2015-08-12 06:23:27 EDT
(In reply to Sravan Kumar Lakkimsetti from comment #20)
> I have tested it using Ubuntu 14.04(gtk 3.10.8) and Kubuntu 15.05(gtk
> 3.14.13) found no issues.

+1 for backporting to 4.5.1.
Comment 23 Marc-André Laperle CLA 2015-08-12 10:11:05 EDT
Bernd, can you test the committed fix (in master) to see if the issue in Trace Compass is fixed or can you remind me what to test?