Bug 536542 - [HiDPI][GTK] Eclipse Photon is unusable on Plasma with a display scale factor of 2
Summary: [HiDPI][GTK] Eclipse Photon is unusable on Plasma with a display scale factor...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.8   Edit
Hardware: PC Linux
: P3 blocker (vote)
Target Milestone: 4.9 M2   Edit
Assignee: Sravan Kumar Lakkimsetti CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 536578 536663 (view as bug list)
Depends on:
Blocks: 534932
  Show dependency tree
 
Reported: 2018-06-30 13:52 EDT by Christoph Obexer CLA
Modified: 2020-08-26 07:34 EDT (History)
10 users (show)

See Also:


Attachments
eclipse photon on plasma scale 2 screenshot (42.53 KB, image/png)
2018-06-30 13:52 EDT, Christoph Obexer CLA
no flags Details
Desktop context menu on kubuntu 18 at 100% (32.07 KB, image/png)
2018-07-04 08:50 EDT, Sravan Kumar Lakkimsetti CLA
no flags Details
Desktop context menu on kubuntu 18 at 200% (51.61 KB, image/png)
2018-07-04 08:55 EDT, Sravan Kumar Lakkimsetti CLA
no flags Details
KDE Plasma, SWT_GTK=0, scale=2 (191.69 KB, image/png)
2018-07-09 09:20 EDT, Thomas Stieler CLA
no flags Details
KDE Plasma, SWT_GTK=1, scale=2 (79.61 KB, image/png)
2018-07-09 09:22 EDT, Thomas Stieler CLA
no flags Details
xrandr --verbose output (13.44 KB, text/plain)
2018-07-16 09:06 EDT, Emond Papegaaij CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Obexer CLA 2018-06-30 13:52:38 EDT
Created attachment 274714 [details]
eclipse photon on plasma scale 2 screenshot

Issues:
 * 25% of the window appear to be used
 * trying to interact with the non scaled menu bar causes it to become properly scaled and makes it really hard to interact.
 * hovering with the mouse causes some UI elements to partially draw in the correct location

this used to be much better probably with "Eclipse Platform 4.8.0.v20180607-1630" reverting to that version isn't possible so I can't check because of "No repository found containing: osgi.bundle,org.eclipse.swt.gtk.linux.x86_64,3.107.0.v20180607-1630" among other similar errors.

openSUSE Tumbleweed
Plasma 5.13.1
GTK libgtk-3-0-3.22.30-3.1.x86_64
libgtk-2_0-0-2.24.32-5.2.x86_64 (AFAIK photon uses GTK3 though)
Comment 1 Sravan Kumar Lakkimsetti CLA 2018-07-02 04:53:55 EDT
We will need more information on this.

Need information of how you configured scalefactor.

should not use swt.autoScale as it doesn't work. You need to set the scalefactor in Display/monitor settings.
Comment 2 Sravan Kumar Lakkimsetti CLA 2018-07-03 07:35:04 EDT
I can see this problem with plasma. I am trying to find a workaround.

With Gnome I don't see this problem
Comment 3 Sravan Kumar Lakkimsetti CLA 2018-07-03 07:36:52 EDT
*** Bug 536578 has been marked as a duplicate of this bug. ***
Comment 4 Thomas Stieler CLA 2018-07-03 07:43:10 EDT
If I can support you with testing etc., please let me know!
Comment 5 Christoph Obexer CLA 2018-07-03 12:48:26 EDT
I wanted to add to this that there may be differences between distributions on the HighDPI front because for example openSUSE reverted an upstream change that made GTK significantly worse on HighDPI screens: https://bugzilla.opensuse.org/show_bug.cgi?id=1022830

If that makes it easier to get working HighDPI with SWT on Plasma+openSUSE or not is something I don't know.

 * swt.autoScale: I did not change anything in the downloaded Photon base installation (I always use the most minimal platform runtime (or similar) and that doesn't set this option in the eclipse.ini)

 * how you configured scalefactor: systemsettings5 > Display and Monitor > Displays: Scale Display (ridiculously large button at the bottom) set to 2.
Comment 6 Jan Richter CLA 2018-07-04 08:22:10 EDT
I might have stumbled over this problem on a system without plasma (I am using i3wm). As I am not sure, if it is exactly the same, I will not flag it as duplicate yet.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=536542

For me it is the same, if I leave swt.autoscale on DEFAULT (like it is set on a fresh Photon installation), then I get these errors. If I deactivate it, the graphic issues go away, but Eclipse does not adjust anymore to my DPI.
Comment 7 Sravan Kumar Lakkimsetti CLA 2018-07-04 08:50:00 EDT
Created attachment 274812 [details]
Desktop context menu on kubuntu 18 at 100%
Comment 8 Sravan Kumar Lakkimsetti CLA 2018-07-04 08:55:03 EDT
Created attachment 274813 [details]
Desktop context menu on kubuntu 18 at 200%

Based on above screenshots I can say the hidpi support is not complete with plasma windows manager. 

You can compare the size of icons and text in the attached images. You'll find the icons are not scaled at 200%. This is a bug on the window manager itself. 

This needs to raised to plasma dev team for their attention. 

In the meanwhile I will try to find a workaround for this
Comment 9 Jan Richter CLA 2018-07-09 08:41:19 EDT
(In reply to Sravan Kumar Lakkimsetti from comment #8)
> Created attachment 274813 [details]
> Desktop context menu on kubuntu 18 at 200%
> 
> Based on above screenshots I can say the hidpi support is not complete with
> plasma windows manager. 
> 
> You can compare the size of icons and text in the attached images. You'll
> find the icons are not scaled at 200%. This is a bug on the window manager
> itself. 
> 
> This needs to raised to plasma dev team for their attention. 
> 
> In the meanwhile I will try to find a workaround for this

The question is: why does Photon breaks this? In old eclipse versions this was fine. And also this bug happens in some other window managers than plasma (i.e. i3wm).
Comment 10 Sravan Kumar Lakkimsetti CLA 2018-07-09 08:50:07 EDT
(In reply to Jan Richter from comment #9)
> (In reply to Sravan Kumar Lakkimsetti from comment #8)
> > Created attachment 274813 [details]
> > Desktop context menu on kubuntu 18 at 200%
> > 
> > Based on above screenshots I can say the hidpi support is not complete with
> > plasma windows manager. 
> > 
> > You can compare the size of icons and text in the attached images. You'll
> > find the icons are not scaled at 200%. This is a bug on the window manager
> > itself. 
> > 
> > This needs to raised to plasma dev team for their attention. 
> > 
> > In the meanwhile I will try to find a workaround for this
> 
> The question is: why does Photon breaks this? In old eclipse versions this
> was fine. And also this bug happens in some other window managers than
> plasma (i.e. i3wm).

in Photon we depend on cairo drawing for our scaling. Cairo has a new parameter device_scale this determines whether the image/window needs to scaled or not. This value needs to be set correctly for scaling to work. by changing display this value should get updated to accordingly. What I found with my testing is this value is not getting set correctly.


The GTK2 implementation still has the old behavior. Can you please check that works for you?
Comment 11 Jan Richter CLA 2018-07-09 09:00:16 EDT
How can I check the device_scale value? And to which value it should be set correctly?
Comment 12 Sravan Kumar Lakkimsetti CLA 2018-07-09 09:10:47 EDT
(In reply to Jan Richter from comment #11)
> How can I check the device_scale value? And to which value it should be set
> correctly?

This value comes from GTK. this should get set to 2 at 200%. This is of type double. So we can have fractional scaling factors as well. Sorry we cannot verify this at user level. This has to be verified at code using GTK apis.
Comment 13 Jan Richter CLA 2018-07-09 09:14:51 EDT
Okay. So currently I have found a workaround with which I can work with eclipse (see my other bugreport or below). I can however still provide further testing, if you have more advice for me.

My workaround (https://bugs.eclipse.org/bugs/show_bug.cgi?id=536663#c13):
With GDK_SCALE=2 and swt.autoscale=true I have all graphics rendered correctly, but twice as big. I can use GDK_DPI_SCALE=0.5 to rescale everything to normal size.
Comment 14 Thomas Stieler CLA 2018-07-09 09:19:11 EDT
I created two screenshots under KDE Plasma with scaling 2.

One with SWT_GTK3=1, which seems to be massively broken (black regions, unscaled icons) and one with SWT_GTK3=0, which looks good...
Comment 15 Thomas Stieler CLA 2018-07-09 09:20:35 EDT
Created attachment 274894 [details]
KDE Plasma, SWT_GTK=0, scale=2
Comment 16 Thomas Stieler CLA 2018-07-09 09:22:07 EDT
Created attachment 274895 [details]
KDE Plasma, SWT_GTK=1, scale=2
Comment 17 Sravan Kumar Lakkimsetti CLA 2018-07-10 04:59:09 EDT
raised https://gitlab.gnome.org/GNOME/gtk/issues/1207 with GTK
Comment 18 Sravan Kumar Lakkimsetti CLA 2018-07-12 09:23:58 EDT
Please use GTK2 mode while we get a workaround for this.
Comment 19 Sravan Kumar Lakkimsetti CLA 2018-07-12 09:25:11 EDT
*** Bug 536663 has been marked as a duplicate of this bug. ***
Comment 20 Emond Papegaaij CLA 2018-07-13 02:57:54 EDT
I can confirm this behavior on Kubuntu 18.04. Disabling theming for a workspace fixes the problem for me: Preferences -> General -> Appearance -> uncheck 'Enable theming'. You might want to start eclipse in GTK2 mode to toggle this setting, because it's quite hard to reach the settings with the broken rendering.
Comment 21 Alexander Kurtakov CLA 2018-07-13 04:30:49 EDT
(In reply to Emond Papegaaij from comment #20)
> I can confirm this behavior on Kubuntu 18.04. Disabling theming for a
> workspace fixes the problem for me: Preferences -> General -> Appearance ->
> uncheck 'Enable theming'. You might want to start eclipse in GTK2 mode to
> toggle this setting, because it's quite hard to reach the settings with the
> broken rendering.

The fact that disabling theming fixes the issue is a really interesting observation.
Comment 22 Emond Papegaaij CLA 2018-07-13 05:38:04 EDT
It turns out some diaglogs are still broken, even with theming disabled. The 'Run Configurations' diaglog is unusable but many others are fine.
Comment 23 Thomas Stieler CLA 2018-07-13 11:21:25 EDT
I can confirm that switching of theming helps a lot, although debug/run/coverage dialogs are still broken!
Comment 24 Emond Papegaaij CLA 2018-07-16 09:06:32 EDT
I want to add to this report that I do not have my displays scaled through plasma. System settings -> Display and Monitor -> Displays shows scale = 1 for my external 4k screen, my laptop 4k screen and my other external HD screen. This last screen is scaled through xrandr using "xrandr --output HDMI-0 --scale 1.5x1.5". I'll attach the "xrandr --verbose" output.
Comment 25 Emond Papegaaij CLA 2018-07-16 09:06:59 EDT
Created attachment 275002 [details]
xrandr --verbose output
Comment 26 Eclipse Genie CLA 2018-07-24 08:47:09 EDT
New Gerrit change created: https://git.eclipse.org/r/126551
Comment 28 Sravan Kumar Lakkimsetti CLA 2018-07-25 07:45:03 EDT
(In reply to Eclipse Genie from comment #27)
> Gerrit change https://git.eclipse.org/r/126551 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> ?id=b88cc81393a99a475dd61a0c92071efd95570dcd

Merged to master
Comment 29 Eclipse Genie CLA 2018-07-26 05:57:24 EDT
New Gerrit change created: https://git.eclipse.org/r/126648
Comment 30 Eclipse Genie CLA 2018-07-26 05:58:38 EDT
New Gerrit change created: https://git.eclipse.org/r/126649
Comment 32 Sravan Kumar Lakkimsetti CLA 2018-07-26 06:04:12 EDT
(In reply to Eclipse Genie from comment #31)
> Gerrit change https://git.eclipse.org/r/126649 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> ?id=eaf5e26f1918f857016823a870a8adff56434568

Fixed overlapping icons problem in the tree
Comment 33 Sravan Kumar Lakkimsetti CLA 2018-09-07 04:10:44 EDT
Verified in 4.9M2
Comment 34 Julien Deantoni CLA 2018-09-22 07:51:15 EDT
Hi,

-DSWT_GTK3=0 and removing the "enable theming" in Windows -> preferences -> appearance solved the problem to me:

#cat /etc/SUSE-brand 
openSUSE
VERSION = 15.0
plasmashell 5.13.5
Comment 35 Jens Reimann CLA 2020-05-27 11:22:57 EDT
This is still a problem:

* Eclipse 2020-03
---
Operating System: Fedora 32
KDE Plasma Version: 5.18.5
KDE Frameworks Version: 5.68.0
Qt Version: 5.13.2
Kernel Version: 5.6.14-300.fc32.x86_64
OS Type: 64-bit
Processors: 8 × Intel® Core™ i7-8665U CPU @ 1.90GHz
Memory: 31.1 GiB of RAM
---

The problem is that the workaround, falling back to GTK2, doesn't work anymore.