mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-06 14:00:55 +03:00
Windows: fixed detection of Windows 11 if custom exe launcher does not specify Windows 10+ compatibility in application manifest (issue #916)
Some checks failed
CI / build (11, ) (push) Has been cancelled
CI / build (17, ) (push) Has been cancelled
CI / build (21, ) (push) Has been cancelled
CI / build (23, ) (push) Has been cancelled
CI / build (8, ) (push) Has been cancelled
Native Libraries / Natives (macos) (push) Has been cancelled
Native Libraries / Natives (ubuntu) (push) Has been cancelled
Native Libraries / Natives (windows) (push) Has been cancelled
CI / snapshot (push) Has been cancelled
CI / release (push) Has been cancelled
Some checks failed
CI / build (11, ) (push) Has been cancelled
CI / build (17, ) (push) Has been cancelled
CI / build (21, ) (push) Has been cancelled
CI / build (23, ) (push) Has been cancelled
CI / build (8, ) (push) Has been cancelled
Native Libraries / Natives (macos) (push) Has been cancelled
Native Libraries / Natives (ubuntu) (push) Has been cancelled
Native Libraries / Natives (windows) (push) Has been cancelled
CI / snapshot (push) Has been cancelled
CI / release (push) Has been cancelled
Windows binaries built and signed locally in clean workspace
This commit is contained in:
@@ -18,7 +18,8 @@ FlatLaf Change Log
|
||||
regression in 3.5)
|
||||
- Popup: Fixed NPE if `GraphicsConfiguration` is `null` on Windows. (issue #921)
|
||||
- Theme Editor: Fixed using color picker on secondary screen.
|
||||
|
||||
- Fixed detection of Windows 11 if custom exe launcher does not specify Windows
|
||||
10+ compatibility in application manifest. (issue #916)
|
||||
|
||||
## 3.5.2
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -30,12 +30,26 @@ HWND getWindowHandle( JNIEnv* env, jobject window );
|
||||
|
||||
//---- Utility ----------------------------------------------------------------
|
||||
|
||||
typedef LONG (WINAPI *RtlGetVersion_Type)( OSVERSIONINFO* );
|
||||
|
||||
extern "C"
|
||||
JNIEXPORT jlong JNICALL Java_com_formdev_flatlaf_ui_FlatNativeWindowsLibrary_getOSBuildNumberImpl
|
||||
( JNIEnv* env, jclass cls )
|
||||
{
|
||||
OSVERSIONINFO info;
|
||||
info.dwOSVersionInfoSize = sizeof( info );
|
||||
info.dwBuildNumber = 0;
|
||||
|
||||
// use RtlGetVersion for the case that app manifest does not specify Windows 10+ compatibility
|
||||
// https://www.codeproject.com/Articles/5336372/Windows-Version-Detection
|
||||
HMODULE ntdllModule = ::GetModuleHandleA( "ntdll.dll" );
|
||||
if( ntdllModule != NULL ) {
|
||||
RtlGetVersion_Type pRtlGetVersion = (RtlGetVersion_Type) ::GetProcAddress( ntdllModule, "RtlGetVersion" );
|
||||
if( pRtlGetVersion != NULL && pRtlGetVersion( &info ) == 0 )
|
||||
return info.dwBuildNumber;
|
||||
}
|
||||
|
||||
// fallback
|
||||
if( !::GetVersionEx( &info ) )
|
||||
return 0;
|
||||
return info.dwBuildNumber;
|
||||
|
||||
Reference in New Issue
Block a user