diff --git a/docs/changes.txt b/docs/changes.txt index e0a072510d..901dbcd4a9 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -262,6 +262,10 @@ wxGTK: - Fix wxListBox minimum size regression in 3.2.5 (#24551). - Allow positioning wxDialog at specified position, at least under X11 (#24552). +wxMSW: + +- Recognize Windows Server 2019 in wxGetOsDescription() (PB, #24598). + wxOSX: - Improve wxSlider ticks appearance (Hartwig Wiesmann, #24532). diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index 7e6f164201..629ca5db5f 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -1097,6 +1097,8 @@ int wxIsWindowsServer() return -1; } +static const int WINDOWS_SERVER2019_BUILD = 17763; + // Windows 11 uses the same version as Windows 10 but its build numbers start // from 22000, which provides a way to test for it. static const int FIRST_WINDOWS11_BUILD = 22000; @@ -1165,13 +1167,20 @@ wxString wxGetOsDescription() case 10: if (info.dwBuildNumber >= FIRST_WINDOWS11_BUILD) + { str = wxIsWindowsServer() == 1 ? "Windows Server 2022" : "Windows 11"; + + } + else if ( wxIsWindowsServer() == 1 ) + { + str = info.dwBuildNumber >= WINDOWS_SERVER2019_BUILD + ? "Windows Server 2019" + : "Windows Server 2016"; + } else - str = wxIsWindowsServer() == 1 - ? "Windows Server 2016" - : "Windows 10"; + str = "Windows 10"; break; }