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

6422025: ThemeReader.cpp can be updated for VC7 #1090

Closed
wants to merge 1 commit into from

Conversation

mrserb
Copy link
Member

@mrserb mrserb commented Nov 6, 2020

Some of the type definitions have been imported from UxTheme.h to the ThemeReader.cpp because at that time we supported the windows OS below XP as well as VC6.

It is time to use UxTheme.h directly, note I did not change how we load this library(JDK_LoadSystemLibrary(), as suggested in the comments of the bug it is not necessary that the application will use the win L&F and it is not necessary to link it directly.

mach5 is green


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Testing

Linux x64 Linux x86 Windows x64 macOS x64
Build ✔️ (5/5 passed) ✔️ (2/2 passed) ✔️ (2/2 passed) ✔️ (2/2 passed)
Test (tier1) ✔️ (9/9 passed) ✔️ (9/9 passed) ✔️ (9/9 passed) ✔️ (9/9 passed)

Issue

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/1090/head:pull/1090
$ git checkout pull/1090

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 6, 2020

👋 Welcome back serb! 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
Copy link

openjdk bot commented Nov 6, 2020

@mrserb The following labels will be automatically applied to this pull request:

  • 2d
  • awt
  • swing

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

@openjdk openjdk bot added 2d client-libs-dev@openjdk.org swing client-libs-dev@openjdk.org awt client-libs-dev@openjdk.org labels Nov 6, 2020
@@ -35,13 +35,6 @@
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;

/* !!!! WARNING !!!!
Copy link
Member Author

Choose a reason for hiding this comment

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

The comment is outdated we do not support win L&F on any Unix.

@@ -299,8 +292,6 @@ public static long getThemeTransitionDuration(String widget, int part,
}
}

public static native boolean isGetThemeTransitionDurationDefined();
Copy link
Member Author

Choose a reason for hiding this comment

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

This method was added in Vista so we guarded it by the runtime check.

&& GetThemePositionFunc
&& SetWindowThemeFunc
&& IsThemeBackgroundPartiallyTransparentFunc
&& GetThemeTransitionDurationFunc
Copy link
Member Author

Choose a reason for hiding this comment

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

Now we check GetThemeTransitionDurationFunc as well.

@mrserb mrserb marked this pull request as ready for review November 6, 2020 08:56
@openjdk openjdk bot added the rfr Pull request is ready for review label Nov 6, 2020
@mrserb
Copy link
Member Author

mrserb commented Nov 6, 2020

/label remove 2d

@openjdk openjdk bot removed the 2d client-libs-dev@openjdk.org label Nov 6, 2020
@openjdk
Copy link

openjdk bot commented Nov 6, 2020

@mrserb
The 2d label was successfully removed.

@mlbridge
Copy link

mlbridge bot commented Nov 6, 2020

Webrevs

@@ -161,67 +122,67 @@ BOOL InitThemes() {
DTRACE_PRINTLN1("InitThemes hModThemes = %x\n", hModThemes);
if(hModThemes) {
DTRACE_PRINTLN("Loaded UxTheme.dll\n");
OpenThemeData = (PFNOPENTHEMEDATA)GetProcAddress(hModThemes,
OpenThemeDataFunc = (PFNOPENTHEMEDATA)GetProcAddress(hModThemes,
"OpenThemeData");
Copy link
Member

Choose a reason for hiding this comment

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

Can't we use the functions directly? I mean we can link to UxTheme.lib and load the UxTheme.dll automatically.
Dynamic loading was necessary for Windows versions before Windows XP where UxTheme.dll doesn't exist.

Copy link
Member Author

Choose a reason for hiding this comment

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

That's was my comment in the description about:

It is time to use UxTheme.h directly, note I did not change how we load this library(JDK_LoadSystemLibrary(), as suggested in the comments of the bug it is not necessary that the application will use the win L&F and it is not necessary to link it directly,

also, the native win L&F is an optional thing.

Copy link
Member

Choose a reason for hiding this comment

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

Thank you for the clarification. I must have missed this note. Yes, I later realised that it could be the reason why you didn't update how the DLL is loaded.
Delay-load is another option, on the other hand there's already the code to load the library and get the function pointers.

@openjdk
Copy link

openjdk bot commented Nov 6, 2020

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

6422025: ThemeReader.cpp can be updated for VC7

Reviewed-by: aivanov

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 6 new commits pushed to the master branch:

  • a9dff94: 8254864: vmTestbase/nsk/jvmti/ResourceExhausted/resexhausted001/TestDescription.java timed out
  • 0b7fba7: 8254270: linux 32 bit build doesn't compile libjdwp/log_messages.c
  • f5d36e6: 8246741: NetworkInterface/UniqueMacAddressesTest: mac address uniqueness test failed
  • 688b10b: 8255561: add tests to check binary compatibility rules for records
  • 727a69f: 8255969: Improve java/io/BufferedInputStream/LargeCopyWithMark.java using jtreg tags
  • 952abea: 8254920: Application launched with jpackage produced .exe crashes JVM

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
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.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Nov 6, 2020
@mrserb
Copy link
Member Author

mrserb commented Nov 7, 2020

/integrate

@openjdk openjdk bot closed this Nov 7, 2020
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Nov 7, 2020
@openjdk
Copy link

openjdk bot commented Nov 7, 2020

@mrserb Since your change was applied there have been 6 commits pushed to the master branch:

  • a9dff94: 8254864: vmTestbase/nsk/jvmti/ResourceExhausted/resexhausted001/TestDescription.java timed out
  • 0b7fba7: 8254270: linux 32 bit build doesn't compile libjdwp/log_messages.c
  • f5d36e6: 8246741: NetworkInterface/UniqueMacAddressesTest: mac address uniqueness test failed
  • 688b10b: 8255561: add tests to check binary compatibility rules for records
  • 727a69f: 8255969: Improve java/io/BufferedInputStream/LargeCopyWithMark.java using jtreg tags
  • 952abea: 8254920: Application launched with jpackage produced .exe crashes JVM

Your commit was automatically rebased without conflicts.

Pushed as commit 358f5d2.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

openjdk-notifier bot referenced this pull request Nov 7, 2020
@mrserb mrserb deleted the JDK-6422025 branch November 7, 2020 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awt client-libs-dev@openjdk.org integrated Pull request has been integrated swing client-libs-dev@openjdk.org
2 participants