Bug 563923 - Scaling on HiDPI with factor 150% broken
Summary: Scaling on HiDPI with factor 150% broken
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.20   Edit
Hardware: PC Linux
: P3 major with 4 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-04 06:25 EDT by Thomas Stieler CLA
Modified: 2022-04-14 14:17 EDT (History)
8 users (show)

See Also:


Attachments
Broken scaling (317.89 KB, image/png)
2020-06-04 06:25 EDT, Thomas Stieler CLA
no flags Details
Scaling issues still there in 4.16 RC2 (74.86 KB, image/png)
2020-06-13 16:13 EDT, Thomas Stieler CLA
no flags Details
Eclipse 4.21 -Dswt.autoScale=150 (163.43 KB, image/png)
2021-09-20 06:47 EDT, Thomas Stieler CLA
no flags Details
Eclipse 4.21 -Dswt.autoScale=200 (144.82 KB, image/png)
2021-09-20 06:47 EDT, Thomas Stieler CLA
no flags Details
Debug Configurations with all workarounds (312.12 KB, image/png)
2021-11-30 04:04 EST, David Matějček CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Stieler CLA 2020-06-04 06:25:30 EDT
Created attachment 283160 [details]
Broken scaling

Hi,

I'm using Eclipse with a 4k monitor for quite a while, but just as long I see severe problems with screen scaling, for now I have to use Eclipse with factor 1 or 2, which both isn't really a fun.

Normally I use KDE/Plasma, but I testet Ubuntu's standard desktop as well, both fail with the desired scaling factor of 150%, set via "-Dswt.autoScale=150".

The issues are massive redrawing issues with black artifacts on application window. While moving the pointer, some parts of the UI are redrawn, but still displayed wrong.

I attached a screenshot as reference.

Interestingly screen scaling seem's to work with both KDE and Ubuntu desktop at a scaling factor of 200%, but as soon as I set "-Dswt.autoScale=150", it fails with same broken UI in both environments.

A long time ago, there was a suggested workarround to disable theming and force usage of GTK2.0, but this doesn't improve, maybe GTK2.0 isn't support anymore?

It would be really nice if this issue could be fixed.
Please let me know if you need further information!

My version are:
   OS: Kubuntu 20.04
   Eclipse Version: 2020-03 (4.15.0)
   Build id: 20200313-1211
Comment 2 Thomas Stieler CLA 2020-06-13 16:12:47 EDT
Teste 4.16 RC 2, unfortunalety same scaling issues with  "-Dswt.autoScale=150"
Comment 3 Thomas Stieler CLA 2020-06-13 16:13:24 EDT
Created attachment 283274 [details]
Scaling issues still there in 4.16 RC2
Comment 4 Sravan Kumar Lakkimsetti CLA 2020-06-14 23:06:39 EDT
(In reply to Thomas Stieler from comment #3)
> Created attachment 283274 [details]
> Scaling issues still there in 4.16 RC2

We do know the problem. Unfortunately this is not a simple problem to fix. Soraphol (Paul) Damrongpiriyapong is working on this one via bug 564097. 

Adding the bug to see also list. 

I am unassigning my self so that Paul can assign this bug to himself
Comment 5 Sravan Kumar Lakkimsetti CLA 2020-06-15 04:42:17 EDT
Assigning to Paul.
Comment 6 Soraphol (Paul) Damrongpiriyapong CLA 2020-06-17 17:23:06 EDT
Hello, I am currently working on the scaling issues with HiDPI. A fixed is on the way, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=564097. This fix however does not address the scaling factor set through the autoScale property, yet. 

Just wondering Thomas, when you were saying that you can use Eclipse at factor 1 or 2, did you set that though your desktop's settings or through the autoScale property?
Comment 7 Thomas Stieler CLA 2020-06-18 03:27:09 EDT
Wenn setting scaling via desktop settings, Eclipse is rendering fine with both factor 100% and 200%.

But as already described: With 200% scaling, I loose a lot of benefits from HiDPI screen, so I use scaling of 150% for my desktop.

With this setting, text is rendered fine, but icons are tiny small, as with default settings, images are IMHO only scaled with integer factor (so 1 or2).

The only way to get Eclipse using 150% for icons is via "-Dswt.autoScale=150", with bad results (black areas within UI).
Comment 8 Soraphol (Paul) Damrongpiriyapong CLA 2020-06-18 09:42:09 EDT
Got it. I'm aware of the icon scaling issue as well, I am trying to fix that right now, so people don't have to resort to the -Dswt launch setting.

One quick question, does your 4k monitor setup include other monitors? I'm asking because many people have actually had issues rendering at 200 scale but I believe that is due to people having multiple monitors at different scaling. Just wanted to verify that theory with your setup, since you can scale at 200.
Comment 9 Thomas Stieler CLA 2020-06-18 10:17:06 EDT
I use only one monitor.
Comment 10 Thomas Stieler CLA 2020-06-18 10:19:09 EDT
So maybe there's another issue with multiple screen setup.

At work I use two monitors, unfortunately we have home office because of this covid-19 issue.
Comment 11 Soraphol (Paul) Damrongpiriyapong CLA 2020-06-26 16:18:57 EDT
Hello, an update on the fixes. There is an integration build out now that has one part of the fix: https://download.eclipse.org/eclipse/downloads/drops4/I20200625-1800/

The build allows for fractional scaling factors if enabled through the system settings. Everything should be okay, as long as there is no -DswtAutoScale flags.

If you would like to run Eclipse on fractional scaling please use the system settings to set this. This is so that SWT can recognize the change in scale.

You may need to enable fractional scaling using this command (may require restart to have an effect):
dconf write /org/gnome/mutter/experimental-features "['scale-monitor-framebuffer']"

There is a fix for icon scaling that should fix any other problems. The change is under review atm.
Comment 12 Thomas Stieler CLA 2020-06-29 11:36:59 EDT
I download the integration build, but as the font's have been already scaled before and the major issue was icon scaling, I cannot really confirm an improvement for me.

As soon as fractional icon scaling is working, I will check again!
Comment 13 Sravan Kumar Lakkimsetti CLA 2020-09-02 04:10:26 EDT
This is actually quite a tough problem to solve. Removing the target milestone
Comment 14 Thomas Stieler CLA 2021-04-28 16:01:35 EDT
Unfortunately this issue still troubles me, now on Eclipse 2021-03.

Any chance to get progress on that?
Comment 15 Thomas Stieler CLA 2021-06-18 12:03:50 EDT
Unfortunately still no progress for 4.20 :-(
Comment 16 Thomas Stieler CLA 2021-09-17 09:46:53 EDT
Tried the next release 4.21

While the output looks different, scaling is unfortunately still unusable...
Comment 17 David Matějček CLA 2021-09-18 18:57:00 EDT
In my case helped using -Dswt.autoScale=100 in eclipse.ini and disabling theming in Eclipse preferences.
Comment 18 Thomas Stieler CLA 2021-09-20 06:47:04 EDT
Created attachment 287170 [details]
Eclipse 4.21 -Dswt.autoScale=150
Comment 19 Thomas Stieler CLA 2021-09-20 06:47:58 EDT
Created attachment 287171 [details]
Eclipse 4.21 -Dswt.autoScale=200
Comment 20 Thomas Stieler CLA 2021-09-20 06:51:15 EDT
Well, disabling scaling via -Dswt.autoScale=100 helps to fix UI issues, but actually doesn't help me, because I would like to get UI icons scaled.

Text scaling already works, but icons are rendered tiny.

I need -Dswt.autoScale=150 or -Dswt.autoScale=200 to get icons scaled in the UI, but with current Eclipse version 4.21 both 150% and 200% scaling factor cause massive problems with UI rendering.

(see Attachements "Eclipse 4.21 -Dswt.autoScale=150" and "Eclipse 4.21 -Dswt.autoScale=200".

Disabling theming doesn't seem to improve the situation...
Comment 21 David Matějček CLA 2021-11-30 04:04:48 EST
Created attachment 287594 [details]
Debug Configurations with all workarounds

Added screenshot with -Dswt.autoScale=100 and disabled theming. The UI looks ok otherwise, but all those windows for Run Configurations/Debug Configurations/External Tool Configurations/Coverage Configurations are broken immediately after I try to add new configuration.