From 274f88c5b883f3f179d15ffe324d6cf547bcc112 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pa=CC=84vels=20Nadtoc=CC=8Cajevs?=
<7645683+bruvzg@users.noreply.github.com>
Date: Sun, 17 Aug 2025 16:34:58 +0300
Subject: [PATCH] [Windows] Fix color picker on old versions of Windows 10.
---
doc/classes/DisplayServer.xml | 6 +++---
doc/classes/Window.xml | 2 +-
platform/windows/display_server_windows.cpp | 3 ++-
platform/windows/os_windows.cpp | 2 +-
4 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml
index 9884860c0b9..3d0808b7405 100644
--- a/doc/classes/DisplayServer.xml
+++ b/doc/classes/DisplayServer.xml
@@ -2592,10 +2592,10 @@
The display server supports initiating window drag and resize operations on demand. See [method window_start_drag] and [method window_start_resize].
- Display server supports [constant WINDOW_FLAG_EXCLUDE_FROM_CAPTURE] window flag.
+ Display server supports [constant WINDOW_FLAG_EXCLUDE_FROM_CAPTURE] window flag. [b]Windows, macOS[/b]
- Display server supports embedding a window from another process. [b]Windows, Linux (X11)[/b]
+ Display server supports embedding a window from another process. [b]Windows, Linux (X11), macOS[/b]
Native file selection dialog supports MIME types as filters.
@@ -3123,7 +3123,7 @@
Window is excluded from screenshots taken by [method screen_get_image], [method screen_get_image_rect], and [method screen_get_pixel].
- [b]Note:[/b] This flag is implemented on macOS and Windows.
+ [b]Note:[/b] This flag is implemented on macOS and Windows (10, 20H1).
[b]Note:[/b] Setting this flag will prevent standard screenshot methods from capturing a window image, but does [b]NOT[/b] guarantee that other apps won't be able to capture an image. It should not be used as a DRM or security measure.
diff --git a/doc/classes/Window.xml b/doc/classes/Window.xml
index 3cfb17473d4..e7af63b8d71 100644
--- a/doc/classes/Window.xml
+++ b/doc/classes/Window.xml
@@ -904,7 +904,7 @@
Windows is excluded from screenshots taken by [method DisplayServer.screen_get_image], [method DisplayServer.screen_get_image_rect], and [method DisplayServer.screen_get_pixel].
- [b]Note:[/b] This flag is implemented on macOS and Windows.
+ [b]Note:[/b] This flag is implemented on macOS and Windows (10, 20H1).
[b]Note:[/b] Setting this flag will prevent standard screenshot methods from capturing a window image, but does [b]NOT[/b] guarantee that other apps won't be able to capture an image. It should not be used as a DRM or security measure.
diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp
index 6a23e93f977..cd6dbcb0ef8 100644
--- a/platform/windows/display_server_windows.cpp
+++ b/platform/windows/display_server_windows.cpp
@@ -149,8 +149,9 @@ bool DisplayServerWindows::has_feature(Feature p_feature) const {
case FEATURE_STATUS_INDICATOR:
case FEATURE_WINDOW_EMBEDDING:
case FEATURE_WINDOW_DRAG:
- case FEATURE_SCREEN_EXCLUDE_FROM_CAPTURE:
return true;
+ case FEATURE_SCREEN_EXCLUDE_FROM_CAPTURE:
+ return (os_ver.dwBuildNumber >= 19041); // Fully supported on Windows 10 Vibranium R1 (2004)+ only, captured as black rect on older versions.
case FEATURE_EMOJI_AND_SYMBOL_PICKER:
return (os_ver.dwBuildNumber >= 17134); // Windows 10 Redstone 4 (1803)+ only.
#ifdef ACCESSKIT_ENABLED
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index c7b0bfd1d7d..b79ad487241 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -639,7 +639,7 @@ String OS_Windows::get_version_alias() const {
} else {
windows_string += "Unknown";
}
- // Windows versions older than 7 cannot run Godot.
+ // Windows versions older than 10 cannot run Godot.
return vformat("%s (build %d)", windows_string, (int64_t)fow.dwBuildNumber);
}