Bug 535123 - [HiDPI][GTK3] Black bands visible in Eclipse UI on x2 display
Summary: [HiDPI][GTK3] Black bands visible in Eclipse UI on x2 display
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.8   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: 4.8 RC4   Edit
Assignee: Sravan Kumar Lakkimsetti CLA
QA Contact: Leo Ufimtsev CLA
URL:
Whiteboard:
Keywords:
Depends on: 534817
Blocks: 537441 535783
  Show dependency tree
 
Reported: 2018-05-25 10:21 EDT by Peter Severin CLA
Modified: 2018-07-27 06:01 EDT (History)
10 users (show)

See Also:
daniel_megert: pmc_approved+
akurtakov: review+
lufimtse: review+
lshanmug: review+


Attachments
Black bands (75.54 KB, image/png)
2018-05-25 10:21 EDT, Peter Severin CLA
no flags Details
Black bands on Ubuntu 18.04 (63.25 KB, image/png)
2018-05-29 08:26 EDT, Peter Severin CLA
no flags Details
I see it in light theme as well on ubuntu 18.0.4 (633.20 KB, image/png)
2018-05-31 03:57 EDT, Wim Jongman CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Severin CLA 2018-05-25 10:21:30 EDT
Created attachment 274197 [details]
Black bands

Eclipse SDK

Version: Photon (4.8)
Build id: I20180524-0900
Comment 1 Thomas Wolf CLA 2018-05-26 04:37:30 EDT
See also the first screenshot in bug 534426. Similar vertical black stripes there, though much finer.
Comment 2 Sravan Kumar Lakkimsetti CLA 2018-05-29 06:15:23 EDT
Can you please let us know the OS and GTK version details?
Comment 3 Peter Severin CLA 2018-05-29 08:26:10 EDT
Created attachment 274238 [details]
Black bands on Ubuntu 18.04

I could reproduce it on Ubuntu 16.04, 18.04 and Debian. Here's the screenshot on Ubuntu 18.04 and the corresponding settings:

org.eclipse.swt.internal.deviceZoom=200
org.eclipse.swt.internal.gdk.backend=x11
org.eclipse.swt.internal.gtk.theme=Ambiance
org.eclipse.swt.internal.gtk.version=3.22.30
Comment 4 Sravan Kumar Lakkimsetti CLA 2018-05-29 08:38:38 EDT
I can reproduce the problem. I am taking this up.
Comment 5 Sravan Kumar Lakkimsetti CLA 2018-05-30 08:46:33 EDT
I See this problem in light and dark themes. I don't see this on Classic and High contrast themes
Comment 6 Sravan Kumar Lakkimsetti CLA 2018-05-31 02:21:48 EDT
If I use different thesmes I don't see this problem. Problem would be with the way themes work Moving to platform UI for comment
Comment 7 Lars Vogel CLA 2018-05-31 03:05:51 EDT
I don't see this with non HDPI, so I believe this is an SWT issue
Comment 8 Wim Jongman CLA 2018-05-31 03:57:01 EDT
Created attachment 274272 [details]
I see it in light theme as well on ubuntu 18.0.4
Comment 9 Lakshmi P Shanmugam CLA 2018-05-31 04:22:05 EDT
Sravan, can you please check if it's a recent regression? I don't remember seeing this issue before.
Comment 10 Sravan Kumar Lakkimsetti CLA 2018-05-31 04:35:38 EDT
(In reply to Wim Jongman from comment #8)
> Created attachment 274272 [details]
> I see it in light theme as well on ubuntu 18.0.4

I can see it in Light theme and Dark theme. I don't see this in Classic and High contrast
Comment 11 Sravan Kumar Lakkimsetti CLA 2018-05-31 04:37:30 EDT
Can some one point me the code for the themes? I would like to check the SWT APIs used there
Comment 12 Lars Vogel CLA 2018-05-31 04:44:10 EDT
(In reply to Sravan Kumar Lakkimsetti from comment #11)
> Can some one point me the code for the themes? I would like to check the SWT
> APIs used there

See the css files in eclipse.platform.ui/org.eclipse.ui.themes. They define properties and via the CSS engine these properties are applied to the widgets.

Best way IMHO to look at CSS issues, is the CSS spy and the CSS scratchpad, which is documented here: http://www.vogella.com/tutorials/Eclipse4CSS/article.html#css-spy 

Update side for installation: http://download.eclipse.org/e4/snapshots/org.eclipse.e4.tools/latest/
Comment 13 Sravan Kumar Lakkimsetti CLA 2018-06-06 08:58:25 EDT
I need some help in reproducing this in pure swt snippet.

the snippet should contain a toolbar with its background set using css. I suspect this bug from css handling in GTK3 on X11
Comment 14 Wim Jongman CLA 2018-06-06 09:08:07 EDT
(In reply to Sravan Kumar Lakkimsetti from comment #13)
> I need some help in reproducing this in pure swt snippet.
> 
> the snippet should contain a toolbar with its background set using css. I
> suspect this bug from css handling in GTK3 on X11

Please provide the snippet and I will run it.
Comment 15 Eclipse Genie CLA 2018-06-07 02:58:20 EDT
New Gerrit change created: https://git.eclipse.org/r/124159
Comment 16 Eclipse Genie CLA 2018-06-07 02:58:24 EDT
New Gerrit change created: https://git.eclipse.org/r/124160
Comment 19 Leo Ufimtsev CLA 2018-06-07 09:01:19 EDT
I investigated a little bit.

I reproduced with the following:
- OS:  Fedora 28, Gtk3.22
- DPI: 200% dpi (and not in any combination in 100% dpi).
- Dark and light (and not on classic). On both Adwaita and Ambiance.

I.e, the factors affecting this bug are 200% dpi and Dark/light platform UI theme.

I.e, workarounds for now:
- use 100% scaling or use 'classic' theme.

I haven't bisected yet. Is this a regression or new bug? Anyone know the last working build?
Comment 20 Leo Ufimtsev CLA 2018-06-07 10:47:34 EDT
I did a bisect. This is the offending commit:
https://git.eclipse.org/r/#/c/123018/

@ Sravan, can you investigate?
Comment 21 Leo Ufimtsev CLA 2018-06-07 15:12:51 EDT
Note to self:

For testing/reproducing, child eclipse & snippets can have hi-dpi forced via:
GDK_SCALE=2   (https://wiki.gnome.org/HowDoI/HiDpi)

We have a chicken & egg situation. Either screenshots work but HiDpi+light/dark theme produce black bars. Or no black bars but broken screenshots.

I narrowed it down to this guy:
Image.java:  iit(int, int) {
 ....

// (current code) Working screenshot. Broken hidpi with light/dark theme.
// https://git.eclipse.org/r/#/c/123018/2/bundles/org.eclipse.swt/Eclipse+SWT/gtk/org/eclipse/swt/graphics/Image.java
surface = GDK.gdk_window_create_similar_surface(GDK.gdk_get_default_root_window(), Cairo.CAIRO_CONTENT_COLOR, width, height);


// (previous) Broken screenshot.  Working hidpi with light/dark theme.
if (GTK.GTK3) {
	surface = Cairo.cairo_image_surface_create(Cairo.CAIRO_FORMAT_ARGB32, width, height);
} else {
	surface = GDK.gdk_window_create_similar_surface(GDK.gdk_get_default_root_window(), Cairo.CAIRO_CONTENT_COLOR, width, height);
}


Anyone have any ideas on how to fix?
Comment 22 Leo Ufimtsev CLA 2018-06-07 16:09:34 EDT
Snippet365.java, GDK_SCALE=2 can be used to reproduce the issue.
Comment 23 Dani Megert CLA 2018-06-08 06:00:05 EDT
(In reply to Leo Ufimtsev from comment #20)
> I did a bisect. This is the offending commit:
> https://git.eclipse.org/r/#/c/123018/
> 
> @ Sravan, can you investigate?

This got reverted for now. Closing this for RC4, but Sravan is looking into fix that fixes both issues (see bug 535630 comment 19).
Comment 24 Eclipse Genie CLA 2018-06-08 06:02:51 EDT
New Gerrit change created: https://git.eclipse.org/r/124241
Comment 25 Eclipse Genie CLA 2018-06-08 06:11:19 EDT
New Gerrit change created: https://git.eclipse.org/r/124242
Comment 27 Alexander Kurtakov CLA 2018-06-08 07:14:20 EDT
Tested and the patch fixes both issues for me. Dani, should we respin RC4 now ?
Comment 28 Dani Megert CLA 2018-06-08 09:55:40 EDT
(In reply to Alexander Kurtakov from comment #27)
> Tested and the patch fixes both issues for me. Dani, should we respin RC4
> now ?

RC4 has been declared. But yes, we can respin and produce RC5 (or RC4+).
Comment 29 Leo Ufimtsev CLA 2018-06-08 11:57:48 EDT
I tested the latest master.

I can confirm that the black bars disappear and screenshots work.
Comment 30 Lakshmi P Shanmugam CLA 2018-06-11 02:23:30 EDT
Verified the latest patchset (4).
Sravan, please update the README.
Comment 31 Eclipse Genie CLA 2018-06-11 02:57:58 EDT
New Gerrit change created: https://git.eclipse.org/r/124317
Comment 32 Eclipse Genie CLA 2018-06-11 02:58:03 EDT
New Gerrit change created: https://git.eclipse.org/r/124318
Comment 33 Sravan Kumar Lakkimsetti CLA 2018-06-11 02:58:47 EDT
(In reply to Eclipse Genie from comment #31)
> New Gerrit change created: https://git.eclipse.org/r/124317

(In reply to Eclipse Genie from comment #32)
> New Gerrit change created: https://git.eclipse.org/r/124318

Updated README with above patches.
Comment 37 Sravan Kumar Lakkimsetti CLA 2018-06-11 04:24:46 EDT
Merged to 4.8_maintenance
Comment 38 Peter Severin CLA 2018-07-27 05:23:45 EDT
I still see black bands in Eclipse 4.9, although in different places. I've filed Bug 537441.