Bug 427511 - [GTK3] [GTK3.10] Some UI is painted outside of its area with GTK 3.10
Summary: [GTK3] [GTK3.10] Some UI is painted outside of its area with GTK 3.10
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.4   Edit
Hardware: PC Linux
: P3 major with 1 vote (vote)
Target Milestone: 4.4 RC1   Edit
Assignee: Snjezana Peco CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-05 14:58 EST by Mickael Istria CLA
Modified: 2015-04-29 01:56 EDT (History)
8 users (show)

See Also:
akurtakov: review+
arunkumar.thondapu: review+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mickael Istria CLA 2014-02-05 14:58:36 EST
Using gtk3.10

After applying workaround for bug 421127 (removing reference to CTabRendering in 
CSS), I could see that in many cases, some UI elements (generally text) gets painted out of its expected region.
See http://imgur.com/rUkbs6a for a screenshot of what it look like.
I investigated a little and got to see what happens when widgets are painted: http://imgur.com/QpaK5cx . The long blue element is the one that is selected when widget is painted (for exmaple because of a resize).

It seems to me that a draw operation is happening when the size is not correctly computed so the operation has effects in area where is shouldn't have.
As I could reproduce it only for elements which have text (trees, editors), I'm wondering whether this could be an issue in computing the size of the text to be displayed as well.
Comment 1 Snjezana Peco CLA 2014-04-28 11:10:33 EDT
The org.eclipse.swt.widgets.Tree.rendererRender(long, long, long, long, long, long, long, long) method expects a cairo for the bin window of GtkViewport, but GTK >= 3.10 sends a cairo for the window of the tree widget. Besides, SWT invalidates the cairo. This isn't a problem in GTK < 3.10 because it always sends a new cairo.
The patch fixes the issue by creating a new cairo whenever something is painted in this method.

The patch: https://git.eclipse.org/r/#/c/25668
Comment 2 Sami Wagiaalla CLA 2014-04-29 14:08:58 EDT
> The patch fixes the issue by creating a new cairo whenever something is
> painted in this method.
> 
> The patch: https://git.eclipse.org/r/#/c/25668

I have tried this out; the tree view is clipped properly but there are a couple of issues:
- Horizontal scrolling does not move the text. Only the arrows.
- The icons don't seem to be drawn. Just the text and arrows.
Comment 3 Snjezana Peco CLA 2014-04-29 15:20:01 EDT
There is another bug for this issue: bug 427480
Comment 4 Sami Wagiaalla CLA 2014-04-29 15:37:23 EDT
> There is another bug for this issue: bug 427480

Hmmm... I may have missed something but I believe the issues on bug 427480 (with the exception of the lack of clipping) are present with or without the patch where as the issues mentioned above are present only after applying the patch.
Comment 5 Snjezana Peco CLA 2014-04-29 16:25:38 EDT
Could you, please, try both of the patches - https://git.eclipse.org/r/#/c/25758 and https://git.eclipse.org/r/#/c/25668?
Comment 6 Sami Wagiaalla CLA 2014-04-30 09:31:28 EDT
(In reply to Snjezana Peco from comment #5)
> Could you, please, try both of the patches -
> https://git.eclipse.org/r/#/c/25758 and https://git.eclipse.org/r/#/c/25668?

Looks good. Horizontal and vertical scroll both work and the content is properly clipped.

I did notice the horizontal scrolling of the highlighting on the selected item is a bit strange. It seems like it is a bit out of sync with the highlighted item.
Comment 7 Snjezana Peco CLA 2014-04-30 11:35:11 EDT
(In reply to Sami Wagiaalla from comment #6)
> (In reply to Snjezana Peco from comment #5)
> 
> I did notice the horizontal scrolling of the highlighting on the selected
> item is a bit strange. It seems like it is a bit out of sync with the
> highlighted item.

I have updated the patch so that GTK also paints a background.
Could you, please, test the patch?
Comment 8 Sami Wagiaalla CLA 2014-04-30 13:30:10 EDT
(In reply to Snjezana Peco from comment #7)
> (In reply to Sami Wagiaalla from comment #6)
> > (In reply to Snjezana Peco from comment #5)
> > 
> > I did notice the horizontal scrolling of the highlighting on the selected
> > item is a bit strange. It seems like it is a bit out of sync with the
> > highlighted item.
> 
> I have updated the patch so that GTK also paints a background.
> Could you, please, test the patch?

All looks good. Content is clipped properly, horizontal and vertical scrolling works as expected.
Comment 9 Alexander Kurtakov CLA 2014-05-09 07:24:05 EDT
Definetely improves the current situation significantly. Let's push it.
Comment 10 Alexander Kurtakov CLA 2014-05-09 07:26:06 EDT
Arun, as there is already the review would you please push if you agree with it?
Comment 11 Arun Thondapu CLA 2014-05-09 12:10:47 EDT
(In reply to Alexander Kurtakov from comment #10)
> Arun, as there is already the review would you please push if you agree with
> it?

Done - http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=090e8dfef891d537ee91a695bdd9547272135b17
Comment 12 Niraj Modi CLA 2015-04-29 01:56:35 EDT
Bug 427511 was RESOLVED_FIXED in 4.4-RC1, but surprisingly below commit was made against this bug 427511 in 4.5 time-frame, which is causing a critical bug 464816:
http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=77d858e5c6ed3ebe8fa843c1bb721ed789ee186a