Skip to content

Commit

Permalink
Merge branch 'JFormDesigner:main' into classx
Browse files Browse the repository at this point in the history
  • Loading branch information
dar-dev authored Nov 29, 2024
2 parents 7f7742c + e064c93 commit f2b007d
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f2b007d

Please sign in to comment.