-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
8321151: JDK-8294427 breaks Windows L&F on all older Windows versions #17173
Conversation
The value of defaultDPI is used in InitThemes and rescale.
Move the parts of the conditional operator to the start of wrapped lines so that it stands out.
👋 Welcome back rmahajan! A progress list of the required criteria for merging this PR into |
/reviewers 2 |
@aivanov-jdk |
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.
Looks good to me.
I tested it on Windows 7, Windows 10 v1607 as well as current versions of Windows 10 and 11. I ran SwingSet2 side-by-side and I didn't spot any differences.
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.
Looks fine
@rajamah This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 129 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@aivanov-jdk, @alisenchung) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
/integrate |
/sponsor |
Going to push as commit f695ca5.
Your commit was automatically rebased without conflicts. |
@aivanov-jdk @rajamah Pushed as commit f695ca5. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Mailing list message from Simon Nash on client-libs-dev: On 22/12/2023 20:19, Rajat Mahajan wrote: Simon |
Mailing list message from Simon Nash on client-libs-dev: On 22/12/2023 20:19, Rajat Mahajan wrote: As I understand it, the original change JDK-8294427 has been backported to JDK 21u, 17u and 11u. What needs to happen to backport this change to 22u and also Simon |
Mailing list message from Aleksei Ivanov on client-libs-dev: Hi Simon, On 2024-01-17 17:53, Simon Nash wrote:
Rajat is backporting this fix to 22u. He will also backport it to Oracle For OpenJDK-based releases, you or anyone from the OpenJDK community https://openjdk.org/guide/#backporting -- |
Issue:
https://bugs.openjdk.org/browse/JDK-8294427 starts to use this API
https://learn.microsoft.com/en-us/windows/win32/api/uxtheme/nf-uxtheme-openthemedatafordpi
which was introduced only in Windows 10 1703.
So the theming engine won't load on anything earlier like the original windows 10 or windows 8.1 etc.
So as an undocumented side-effect it completely breaks the theming of Windows L&F on anything earlier
and it falls back to hard-coded rendering like Windows NT/Windows 2000
Whilst those older versions are technically out of at least "mainstream" support, this is not the way
to make that breaking change and I see this fix has been backported to older releases which expect stability
it seems to me that this code should NOT fail if the new API is missing and instead fall back to the old code.
No one will care about a pixel being off on hi-dpi if the entire UI is wrong.
Fix:
Added fallback path to support older versions of Windows that do not support OpenThemeDataForDpi().
Testing:
Tested on my Windows 10 machine with and without the fallback path and it works as expected.
Alexey tested on Windows 7 and on Windows 10 v1607 — it works correctly (jdk 21.0.2 can't render themes as reported).
He also tested on Windows 11 .
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/17173/head:pull/17173
$ git checkout pull/17173
Update a local copy of the PR:
$ git checkout pull/17173
$ git pull https://git.openjdk.org/jdk.git pull/17173/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 17173
View PR using the GUI difftool:
$ git pr show -t 17173
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/17173.diff
Webrev
Link to Webrev Comment