Skip to content
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

Closed
wants to merge 7 commits into from

Conversation

rajamah
Copy link
Member

@rajamah rajamah commented Dec 21, 2023

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

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (2 reviews required, with at least 1 Reviewer, 1 Author)

Issue

  • JDK-8321151: JDK-8294427 breaks Windows L&F on all older Windows versions (Bug - P4)

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

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 21, 2023

👋 Welcome back rmahajan! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Dec 21, 2023
@openjdk
Copy link

openjdk bot commented Dec 21, 2023

@rajamah The following label will be automatically applied to this pull request:

  • client

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the client client-libs-dev@openjdk.org label Dec 21, 2023
@mlbridge
Copy link

mlbridge bot commented Dec 21, 2023

Webrevs

@aivanov-jdk
Copy link
Member

/reviewers 2

@openjdk
Copy link

openjdk bot commented Dec 21, 2023

@aivanov-jdk
The total number of required reviews for this PR (including the jcheck configuration and the last /reviewers command) is now set to 2 (with at least 1 Reviewer, 1 Author).

Copy link
Member

@aivanov-jdk aivanov-jdk left a 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.

Copy link
Contributor

@alisenchung alisenchung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine

@openjdk
Copy link

openjdk bot commented Dec 21, 2023

@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:

8321151: JDK-8294427 breaks Windows L&F on all older Windows versions

Reviewed-by: aivanov, achung

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 master branch:

  • 93fedc1: 8321802: (zipfs) Add validation of incorrect LOC signature in ZipFileSystem
  • 1230853: 8322163: runtime/Unsafe/InternalErrorTest.java fails on Alpine after JDK-8320886
  • dce7a57: 8321683: Tests fail with AssertionError in RangeWithPageSize
  • c53f845: 8322539: Parallel: Remove duplicated methods in PSAdaptiveSizePolicy
  • 84c2379: 8320139: [JVMCI] VmObjectAlloc is not generated by intrinsics methods which allocate objects
  • 3b908c4: 8319795: Static huge pages are not used for CodeCache
  • 1802601: 8293623: Simplify G1ConcurrentRefineThreadControl
  • 6de23bf: 8322418: Problem list gc/TestAllocHumongousFragment.java subtests for 8298781
  • aff659a: 8322538: remove fatal from JVM_VirtualThread functions for !INCLUDE_JVMTI
  • 05745e3: 8319548: Unexpected internal name for Filler array klass causes error in VisualVM
  • ... and 119 more: https://git.openjdk.org/jdk/compare/25dc4762b419a6b09d17d9055b1f75e4b531458a...master

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 in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Dec 21, 2023
@rajamah
Copy link
Member Author

rajamah commented Dec 22, 2023

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Dec 22, 2023
@openjdk
Copy link

openjdk bot commented Dec 22, 2023

@rajamah
Your change (at version 939d195) is now ready to be sponsored by a Committer.

@aivanov-jdk
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Dec 22, 2023

Going to push as commit f695ca5.
Since your change was applied there have been 129 commits pushed to the master branch:

  • 93fedc1: 8321802: (zipfs) Add validation of incorrect LOC signature in ZipFileSystem
  • 1230853: 8322163: runtime/Unsafe/InternalErrorTest.java fails on Alpine after JDK-8320886
  • dce7a57: 8321683: Tests fail with AssertionError in RangeWithPageSize
  • c53f845: 8322539: Parallel: Remove duplicated methods in PSAdaptiveSizePolicy
  • 84c2379: 8320139: [JVMCI] VmObjectAlloc is not generated by intrinsics methods which allocate objects
  • 3b908c4: 8319795: Static huge pages are not used for CodeCache
  • 1802601: 8293623: Simplify G1ConcurrentRefineThreadControl
  • 6de23bf: 8322418: Problem list gc/TestAllocHumongousFragment.java subtests for 8298781
  • aff659a: 8322538: remove fatal from JVM_VirtualThread functions for !INCLUDE_JVMTI
  • 05745e3: 8319548: Unexpected internal name for Filler array klass causes error in VisualVM
  • ... and 119 more: https://git.openjdk.org/jdk/compare/25dc4762b419a6b09d17d9055b1f75e4b531458a...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Dec 22, 2023
@openjdk openjdk bot closed this Dec 22, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Dec 22, 2023
@openjdk
Copy link

openjdk bot commented Dec 22, 2023

@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.

@mlbridge
Copy link

mlbridge bot commented Dec 24, 2023

Mailing list message from Simon Nash on client-libs-dev:

On 22/12/2023 20:19, Rajat Mahajan wrote:
Thanks very much for your work on this, much appreciated.

Simon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/client-libs-dev/attachments/20231224/3ec85f21/attachment.htm>

@mlbridge
Copy link

mlbridge bot commented Jan 17, 2024

Mailing list message from Simon Nash on client-libs-dev:

On 22/12/2023 20:19, Rajat Mahajan wrote:
I have tested this using JDK 23 build 5 and it works as expected.

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
these older versions?

Simon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/client-libs-dev/attachments/20240117/cb8811ec/attachment.htm>

@mlbridge
Copy link

mlbridge bot commented Jan 18, 2024

Mailing list message from Aleksei Ivanov on client-libs-dev:

Hi Simon,

On 2024-01-17 17:53, Simon Nash wrote:

I have tested this using JDK 23 build 5 and it works as expected.

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 these older versions?

Rajat is backporting this fix to 22u. He will also backport it to Oracle
JDK 21u, 17u and 11u.

For OpenJDK-based releases, you or anyone from the OpenJDK community
needs to backport the fix into corresponding releases. For more
information, see Backporting section in OpenJDK Developers? Guide, in
particular ?Requesting approvals for backports? and ?Using the Skara
tooling to help with backports?:

https://openjdk.org/guide/#backporting
https://openjdk.org/guide/#requesting-approvals-for-backports
https://openjdk.org/guide/#using-the-skara-tooling-to-help-with-backports

--
Regards,
Alexey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client client-libs-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

3 participants