-
Notifications
You must be signed in to change notification settings - Fork 187
Allow smooth scaling for 100% monitors too #1809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow smooth scaling for 100% monitors too #1809
Conversation
HeikoKlare
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change looks fine to me. If I am not mistaken, it only introduced one change in behavior, which might be considered. It is the following scenario:
- Running on GTK
- Starting with or changing to a deviceZoom that is not a multiple of 100 (like 150), which then enables "smooth" scaling
- Changing to a deviceZoom of 100 (which previously kept "smooth" scaling and now switches back to "nearest" scaling)
On GTK, this is triggered by Display#dpiChanged(). What might be the result? Images are initially created for 150% scale and when then scaled down to 100% after changing deviceZoom to 100, this rescaling happens with "nearest" instead of "smooth", leading to bad results.
Maybe it makes more sense if we say that when auto-scaling was set to "smooth" once, it will stay at "smooth", no matter to what deviceZoom the value is changed?
|
@HeikoKlare so all in all you propose:
All of this shall be done for Windows and Linux (never for Mac) and only when using the "auto" scale mode. Is that correct? |
|
And of course, in Windows this only applies when activating the monitor-specific scaling |
|
Exactly 👍 Just that I would apply the logic to Linux only. On Windows I would use "nearest" unless monitor-specific scaling is enabled (then use "smooth" but also when deviceZoom is 100). |
fdbd7b7 to
af36324
Compare
|
Done @HeikoKlare |
3e5f932 to
a0aebf9
Compare
|
In a0aebf9 I made sure that the corner case of coming back to a 100% monitor in Linux remains unchanged by this PR i.e.
|
bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/DPIUtil.java
Outdated
Show resolved
Hide resolved
Do not change the logic for Linux: coming back to 100% monitor stays in the current mode. Co-authored-by: Heiko Klare <[email protected]>
a0aebf9 to
8dace1d
Compare
Smooth scaling is used if:
In Linux, once the mode changes to smooth, it stays in smooth.
How to test
ControlExamplewith the following VM parameters:Expected result
In Windows
The
autoScaleMethodshould always be set toSMOOTH(inorg.eclipse.swt.internal.DPIUtil.setDeviceZoom(int))In Linux
NEARESTautoScaleMethodshould be set toSMOOTHwhen starting at/switching to a monitor with a "fractional" zoom level (e.g. 150%).SMOOTHmode, it should never switch back toNEARESTIn Mac
No changes: never
SMOOTH.