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

Bug 466499

Summary: [GTK3] [GTK3.14] Path text not drawn in column of commit dialog window
Product: [Eclipse Project] Platform Reporter: Marc-André Laperle <malaperle>
Component: SWTAssignee: Snjezana Peco <snjezana.peco>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: adietish, akurtakov, arunkumar.thondapu, daniel_megert, exdata2, gapage, janosbinder, loskutov, luis.de.sousa, markus.kell.r, matt_miraglia, neillfontes, oded, peter, renan.puppo, renda.krell, sbernard, scarabol, snjezana.peco, wywrzal
Version: 4.5Flags: akurtakov: review+
arunkumar.thondapu: review+
Target Milestone: 4.5.1   
Hardware: PC   
OS: Linux   
See Also: https://git.eclipse.org/r/48343
https://bugs.eclipse.org/bugs/show_bug.cgi?id=461251
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=e32fa8a623210ebcb62b7d869996492857cb244c
https://git.eclipse.org/r/53470
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=a41f152c868984b41b73945f374966ad621c3e13
https://bugs.eclipse.org/bugs/show_bug.cgi?id=480032
Whiteboard:
Bug Depends on:    
Bug Blocks: 441566, 467933, 474628    
Attachments:
Description Flags
Using GTK3
none
Using GTK2
none
a screenshot none

Description Marc-André Laperle CLA 2015-05-05 17:44:56 EDT
Created attachment 253193 [details]
Using GTK3

Using Ubuntu 15.04, GTK 3.14.12
Eclipe 4.5-I20150504-2000
EGit 4.0.0.201505042013

Using EGit, open the commit dialog with some files to be committed. The path column has no text. The file names should be visible. See attached screenshot.
Comment 1 Marc-André Laperle CLA 2015-05-05 17:45:12 EDT
Created attachment 253194 [details]
Using GTK2
Comment 2 Marc-André Laperle CLA 2015-05-05 18:34:27 EDT
It works correctly on Ubuntu 14.04 with GTK 3.10.8.
Comment 3 Eclipse Genie CLA 2015-05-21 04:43:56 EDT
New Gerrit change created: https://git.eclipse.org/r/48343
Comment 4 Snjezana Peco CLA 2015-05-21 04:46:59 EDT
This issue has been introduced by GTK 3.14.0. 
It can be reproduced by running the following snippet:

http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet050DelegatingStyledCellLabelProvider.java

You should run the snippet with GTK >= 3.14.0 and uncheck only one from the two "Owner draw ..." checkboxes.

The patch https://git.eclipse.org/r/48343 fixes the issue. 
I have tested most of the bugs related to bug 446075 and bug 459117.
It also fixes bug 461251.
Comment 5 Snjezana Peco CLA 2015-05-23 12:09:55 EDT
In reply to Alexander Kurtakov
> SO the problem is that GTK_IS_CELL_RENDERER_PIXBUF if given pixbuf returns 
> false and the patch assumes that every renderer is pixbuf_renderer. This 
> doesn't sound correct to me and my gut feelings are telling me this will cause 
> other problems. Is there some change in the way renderers are supposed to be 
> registered with 3.14 ? Entry point for what/how is registered in SWT is 
> Display.createDisplay(DeviceData) . The approach taken in this patch looks too > risky as it will make toggle/text renderers enter this codepath.

There aren't any changes related to registering renderers in 3.14.
However, GTK < 3.14 sends two rendererRender signals for every tree cell. SWT creates measureItem/eraseItem and paintItem events in rendererRender based on those two signals.
GTK >= 3.14 also sends two signals for cell 0, but only one (paint) for other cells.
The patch creates the additional measureItem/eraseItem event for other cells if columnIndex != 0 and version >= 3.14 regardless of GTK_IS_CELL_RENDERER_PIXBUF.

I have updated the patch to fix bug 467933.
Comment 6 Snjezana Peco CLA 2015-05-26 16:24:27 EDT
The patch also fixes the issue described in https://issues.jboss.org/browse/JBIDE-19853.
Comment 7 Marc-André Laperle CLA 2015-06-01 16:13:27 EDT
(In reply to Snjezana Peco from comment #5)
> GTK >= 3.14 also sends two signals for cell 0, but only one (paint) for
> other cells.

I'm trying to understand a bit better. So is this a bug in GTK? If that's the case, it might get fixed in a 3.14.x release and break again. Of course I'm not saying code should work forever :) but if it's a bug in GTK I think it might need a bit further investigation.
Comment 8 Andrey Loskutov CLA 2015-06-01 17:34:20 EDT
*** Bug 466229 has been marked as a duplicate of this bug. ***
Comment 9 Markus Keller CLA 2015-06-03 08:30:08 EDT
On Ubuntu 12.04 with GTK 3.4.2, https://git.eclipse.org/r/#/c/48343/5 produces rendering artifacts when running attachment 253901 [details]. It looks like the image is always painted twice. The second time, it uses wrong coordinates (image too much in the upper-left).
Comment 10 Snjezana Peco CLA 2015-06-29 09:46:46 EDT
*** Bug 471125 has been marked as a duplicate of this bug. ***
Comment 11 Andrey Loskutov CLA 2015-07-03 05:32:22 EDT
*** Bug 471781 has been marked as a duplicate of this bug. ***
Comment 12 Andrey Loskutov CLA 2015-07-03 05:39:07 EDT
This should go in 4.5.1. We receive lot of bug requests in egit because of that.

(In reply to Markus Keller from comment #9)
> On Ubuntu 12.04 with GTK 3.4.2, https://git.eclipse.org/r/#/c/48343/5
> produces rendering artifacts when running attachment 253901 [details]. It
> looks like the image is always painted twice. The second time, it uses wrong
> coordinates (image too much in the upper-left).

The patch is not required for GTK 3.4.2, so probably we miss some checks for GTK >= 3.14.x?
Comment 13 Snjezana Peco CLA 2015-07-06 17:21:04 EDT
(In reply to Markus Keller from comment #9)
> On Ubuntu 12.04 with GTK 3.4.2, https://git.eclipse.org/r/#/c/48343/5
> produces rendering artifacts when running attachment 253901 [details]. It
> looks like the image is always painted twice. The second time, it uses wrong
> coordinates (image too much in the upper-left).


With and without the patch, your snippet renders images differently for different versions of GTK.
I am not sure what we would have to do within the patch. 
Images with GTK 3.4.2 are smaller without it.
Maybe we should create a new bug.
See the attachment.
Comment 14 Snjezana Peco CLA 2015-07-06 17:26:03 EDT
Created attachment 254993 [details]
a screenshot
Comment 15 René Krell CLA 2015-07-07 10:43:17 EDT
I can confirm the problem initially described with the empty Path column in the Git commit window in Version: Mars Release (4.5.0), Build id: 20150621-1200.
Using GTK 3.16.4.

I get the same problem like shown on the attachment "Using GTK3 (43.06 KB, image/png), 2015-05-05 17:44 EDT, Marc-Andre Laperle"

Regarding to the fixes discussed here: Is this the same issue or should I raise a new one?
Comment 16 Snjezana Peco CLA 2015-07-07 11:05:09 EDT
(In reply to René Krell from comment #15)
> I can confirm the problem initially described with the empty Path column in
> the Git commit window in Version: Mars Release (4.5.0), Build id:
> 20150621-1200.
> Using GTK 3.16.4.
> 
> I get the same problem like shown on the attachment "Using GTK3 (43.06 KB,
> image/png), 2015-05-05 17:44 EDT, Marc-Andre Laperle"
> 
> Regarding to the fixes discussed here: Is this the same issue or should I
> raise a new one?


Yes, it is the same issue.
Comment 17 Alexander Kurtakov CLA 2015-07-08 12:33:47 EDT
Markus, do you still see the issue and oppose landing the patch? I don't have anything with that old gtk to confirm.
Comment 18 Matthias Sohn CLA 2015-07-10 02:39:40 EDT
*** Bug 451232 has been marked as a duplicate of this bug. ***
Comment 19 Matthias Sohn CLA 2015-07-21 12:01:44 EDT
*** Bug 473192 has been marked as a duplicate of this bug. ***
Comment 20 Leo Ufimtsev CLA 2015-07-29 17:22:25 EDT
I reproduced the issue on my setup. (F22, Gtk3.16).

Then tested path on: 
Gtk2.24
Gtk3.12
Gtk3.14
Gtk3.16

Now on Gtk3.14+ text is visible in the commit message. Nice.

I looked around a child Eclipse and did not find anything to be broken. 
Doesn't break any JUnit tests either.
Comment 22 Alexander Kurtakov CLA 2015-07-30 09:38:11 EDT
Pushed to master.
Comment 23 Eclipse Genie CLA 2015-08-10 07:39:08 EDT
New Gerrit change created: https://git.eclipse.org/r/53470
Comment 24 Arun Thondapu CLA 2015-08-10 08:43:33 EDT
*** Bug 474397 has been marked as a duplicate of this bug. ***
Comment 25 Arun Thondapu CLA 2015-08-10 08:44:37 EDT
Reopening to fix in 4.5.1
Comment 27 Arun Thondapu CLA 2015-08-12 07:58:37 EDT
(In reply to Eclipse Genie from comment #26)
> Gerrit change https://git.eclipse.org/r/53470 was merged to
> [R4_5_maintenance].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> ?id=a41f152c868984b41b73945f374966ad621c3e13

Pushed the patch as Alex and I agreed that it is important to fix this for 4.5.1.
Comment 28 Marc-André Laperle CLA 2015-08-19 18:25:10 EDT
*** Bug 467933 has been marked as a duplicate of this bug. ***
Comment 29 Snjezana Peco CLA 2015-09-22 10:06:03 EDT
*** Bug 467511 has been marked as a duplicate of this bug. ***
Comment 30 Andrey Loskutov CLA 2015-10-17 13:32:16 EDT
*** Bug 480032 has been marked as a duplicate of this bug. ***
Comment 31 Andrey Loskutov CLA 2015-10-21 07:58:49 EDT
FYI: probably there are still few issues left, see bug 480032 and bug 480292 reported for 4.5.1.
Comment 32 Snjezana Peco CLA 2015-10-21 14:04:54 EDT
(In reply to Andrey Loskutov from comment #31)
> FYI: probably there are still few issues left, see bug 480032 and bug 480292
> reported for 4.5.1.

I can't reproduce the issue.
I have tested Eclipse 4.5.1 and the current swt master with GTK 3.10.8, GTK 3.14.13, GTK 3.16.7 and GTK 3.18.2.
Comment 33 Andrey Loskutov CLA 2016-01-13 10:04:49 EST
*** Bug 485759 has been marked as a duplicate of this bug. ***