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
Conversation
👋 Welcome back serb! A progress list of the required criteria for merging this PR into |
@@ -35,13 +35,6 @@ | |||
import java.util.concurrent.locks.ReadWriteLock; | |||
import java.util.concurrent.locks.ReentrantReadWriteLock; | |||
|
|||
/* !!!! WARNING !!!! |
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 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(); |
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.
This method was added in Vista so we guarded it by the runtime check.
&& GetThemePositionFunc | ||
&& SetWindowThemeFunc | ||
&& IsThemeBackgroundPartiallyTransparentFunc | ||
&& GetThemeTransitionDurationFunc |
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.
Now we check GetThemeTransitionDurationFunc
as well.
/label remove 2d |
@mrserb |
@@ -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"); |
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.
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.
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.
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.
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.
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.
@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:
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
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
/integrate |
@mrserb Since your change was applied there have been 6 commits pushed to the
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. |
Some of the type definitions have been imported from
UxTheme.h
to theThemeReader.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
Testing
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/1090/head:pull/1090
$ git checkout pull/1090