Community
Participate
Working Groups
Unfortunately, HiDPI support on GTK and Windows is not at an acceptable level for Neon. I tried to improve image scaling via bug 97506, but the solution only works on GTK. Mac and Windows suffer from bug 493455. Furthermore, at least on Windows, there are still problems in text editors where lines sometimes jump up or down a bit when scrolling, moving the caret, or changing the selection. I think at this point, the best solution is to ship with defaults that only use integer scale factors. This is a common solution at least on GTK, see bug 489771 comment 40. On GTK, we can offer the better image interpolation method for users who want to run at different scale factors. I'll update https://git.eclipse.org/r/70415 with this solution, which is a combination of fixes discussed in bug 97506, bug 489771, and bug 489466. The old system property swt.enable.autoScale will be removed and replaced by these two: /** * System property that controls the autoScale functionality. * <ul> * <li><b>false</b>: deviceZoom is set to 100%</li> * <li><b>integer</b>: deviceZoom depends on the current display resolution, * but only uses integer multiples of 100%. The detected native zoom is * generally rounded down (e.g. 150% => 100%), unless close to the next * multiple.</li> * <li><b>quarter</b>: deviceZoom depends on the current display resolution, * but only uses integer multiples of 25%. The detected native zoom is * rounded to the closest permissible value.</li> * <li><b>exact</b>: deviceZoom uses the native zoom (with 1% as minimal * step).</li> * <li><i><value></i>: deviceZoom uses the given integer value in * percent as zoom level.</li> * </ul> * The current default is "integer". */ private static final String SWT_AUTOSCALE = "swt.autoScale"; /** * System property that controls the method for scaling images: * <ul> * <li>"nearest": nearest-neighbor interpolation, may look jagged</li> * <li>"smooth": smooth edges, may look blurry</li> * </ul> * The current default is to use "nearest", except on * GTK when the deviceZoom is not an integer multiple of 100%. * The smooth strategy doesn't work on Win32 and Cocoa, see <a href="https://bugs.eclipse.org/493455">bug 493455</a>. */ private static final String SWT_AUTOSCALE_METHOD = "swt.autoScale.method";
*** Bug 489466 has been marked as a duplicate of this bug. ***
I've tested https://git.eclipse.org/r/#/c/70415/6 on all 3 platforms, and I think we should push this for RC1. SWT committers please review and comment. I've included the -Dswt.autoScale=quarter method because that's what we had since bug 489771.
Is there any chance for RC2 for this bug? As far as I can see the RC1 is frozen now?
Created attachment 261670 [details] visual studio @100%
Created attachment 261671 [details] visual studio @150%
(In reply to Andrey Loskutov from comment #3) > Is there any chance for RC2 for this bug? As far as I can see the RC1 is > frozen now? We plan to ask for a respin to include this in RC1.
Created attachment 261673 [details] with patch @150%
Created attachment 261674 [details] with patch @155%
Created attachment 261675 [details] with patch @175%
Created attachment 261676 [details] without patch @150%
I used my phone camera to take these pictures. With the attached patch there is a mismatch of text and icon sizes and alignment. One problem I notice here is the icons are drawn at 100% even for a scalefactor of 155%.
(In reply to Sravan Kumar Lakkimsetti from comment #11) > I used my phone camera to take these pictures. With the attached patch there > is a mismatch of text and icon sizes and alignment. > > One problem I notice here is the icons are drawn at 100% even for a > scalefactor of 155%. Behavior on Windows with latest gerrit: 100 to 174% DPI settings are rounding to 100% 175 to 200% DPI settings are rounding to 200%
(In reply to Sravan Kumar Lakkimsetti from comment #11) > One problem I notice here is the icons are drawn at 100% even for a > scalefactor of 155%. Yes, that's by design. GTK apps like gedit even use the @1x icon up to 199%. I did some experiments and found that it's OK to use the @2x icon on 175%. But at 150%, the @2x icons are too big. And without good auto-scaling at non-integer scale factors, the @1x and @2x versions are all we have. In the SDK, we could ship with @1.5x icons, but as said before, we cannot assume that all plug-ins will add HiDPI icons promptly, and without a good fallback, actual Eclipse installs will look broken (users rarely work with a plain SDK). And to clarify the many options in the new system properties: These are not meant to be advertised to normal users. They are considered temporary and experimental, and they are there to: a) allow devs and curious users to play with different options b) allow users to disable the feature in case of new problems we're not currently aware of (e.g. Linux systems other than Ubuntu and CentOS, where we could only do limited testing)
Gerrit change https://git.eclipse.org/r/70415 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=487efd11899ecb2796ce34f118afac7f29e65d2d
I fixed the Javadoc problem Niraj mentioned in the Gerrit, and I've pushed the fix to master. Will request an RC1 rebuild.
Verified fix in Build id: I20160512-1000 on Win7.
Until SWT version 4.621 (before commit 487efd11) I could disable the autoscaling feature on HiDPI monitors by setting the VM option "swt.enable.autoScale" to "false". How to disable it now?
Also very important: how to disable the autoscaling for the GC draw operations?
(In reply to Thomas Singer from comment #17) > Until SWT version 4.621 (before commit 487efd11) I could disable the > autoscaling feature on HiDPI monitors by setting the VM option > "swt.enable.autoScale" to "false". How to disable it now? you can use -Dswt.autoScale=false now
Thanks. I've used in the mean-time DPIUtil.setDeviceZoom(100); after creating the display instance.