[Win32] Remove runtime change of process DPI awareness#3363
Open
HeikoKlare wants to merge 1 commit into
Open
Conversation
SWT initialization modifies the process DPI awareness via the static initializer of the OS class. This has been implemented for DPI awareness on Windows Vista long time ago. Changing process DPI awareness programmatically is discouraged and should rather be done by the application's manifest. In addition, relevant executables into which SWT is embedded (JVM, Equinox launcher etc.) already have state-of-the-art settings for DPI awareness, which even activate higher levels of DPI awareness than what the call to setProcessDPIAware (conforming to "System" DPI awareness) does. In consequence, this call has no benefit but may rather interfere with DPI awareness settings already done via the manifest. This change thus removes the obsolete programmatic setting of process DPI awareness along with the now unused native method.
5848adc to
23d3655
Compare
Contributor
Contributor
Are there any known side-effects of this in the wild? |
Contributor
Author
No, I am not aware of any. From the API documentation, I would expect the method to "downgrade" the DPI awareness, but even though the method returns "true" (which means "success"), it does actually not change the DPI awareness (otherwise we would have already noticed at many places). The processes still run at PerMonitorV2, so it effectively seems to only upgrade if no DPI awareness is set. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SWT initialization modifies the process DPI awareness via the static initializer of the OS class. This has been implemented for DPI awareness on Windows Vista long time ago (c9bc8bf). Changing process DPI awareness programmatically is discouraged and should rather be done by the application's manifest: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setprocessdpiaware
In addition, relevant executables into which SWT is embedded (JVM, Equinox launcher etc.) already have state-of-the-art settings for DPI awareness, which even activate higher levels of DPI awareness than what the call to
setProcessDPIAware(conforming to "System" DPI awareness) does. In consequence, this call has no benefit but may rather interfere with DPI awareness settings already done via the manifest.This change thus removes the obsolete programmatic setting of process DPI awareness along with the now unused native method.