Merge pull request #109694 from bruvzg/old_win_cap

[Windows] Fix color picker on old versions of Windows 10.
This commit is contained in:
Thaddeus Crews 2025-08-18 08:29:13 -05:00
commit 42224bb750
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC
4 changed files with 7 additions and 6 deletions

View file

@ -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]. The display server supports initiating window drag and resize operations on demand. See [method window_start_drag] and [method window_start_resize].
</constant> </constant>
<constant name="FEATURE_SCREEN_EXCLUDE_FROM_CAPTURE" value="28" enum="Feature"> <constant name="FEATURE_SCREEN_EXCLUDE_FROM_CAPTURE" value="28" enum="Feature">
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]
</constant> </constant>
<constant name="FEATURE_WINDOW_EMBEDDING" value="29" enum="Feature"> <constant name="FEATURE_WINDOW_EMBEDDING" value="29" enum="Feature">
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]
</constant> </constant>
<constant name="FEATURE_NATIVE_DIALOG_FILE_MIME" value="30" enum="Feature"> <constant name="FEATURE_NATIVE_DIALOG_FILE_MIME" value="30" enum="Feature">
Native file selection dialog supports MIME types as filters. Native file selection dialog supports MIME types as filters.
@ -3123,7 +3123,7 @@
</constant> </constant>
<constant name="WINDOW_FLAG_EXCLUDE_FROM_CAPTURE" value="9" enum="WindowFlags"> <constant name="WINDOW_FLAG_EXCLUDE_FROM_CAPTURE" value="9" enum="WindowFlags">
Window is excluded from screenshots taken by [method screen_get_image], [method screen_get_image_rect], and [method screen_get_pixel]. 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. [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.
</constant> </constant>
<constant name="WINDOW_FLAG_POPUP_WM_HINT" value="10" enum="WindowFlags"> <constant name="WINDOW_FLAG_POPUP_WM_HINT" value="10" enum="WindowFlags">

View file

@ -904,7 +904,7 @@
</constant> </constant>
<constant name="FLAG_EXCLUDE_FROM_CAPTURE" value="9" enum="Flags"> <constant name="FLAG_EXCLUDE_FROM_CAPTURE" value="9" enum="Flags">
Windows is excluded from screenshots taken by [method DisplayServer.screen_get_image], [method DisplayServer.screen_get_image_rect], and [method DisplayServer.screen_get_pixel]. 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. [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.
</constant> </constant>
<constant name="FLAG_POPUP_WM_HINT" value="10" enum="Flags"> <constant name="FLAG_POPUP_WM_HINT" value="10" enum="Flags">

View file

@ -149,8 +149,9 @@ bool DisplayServerWindows::has_feature(Feature p_feature) const {
case FEATURE_STATUS_INDICATOR: case FEATURE_STATUS_INDICATOR:
case FEATURE_WINDOW_EMBEDDING: case FEATURE_WINDOW_EMBEDDING:
case FEATURE_WINDOW_DRAG: case FEATURE_WINDOW_DRAG:
case FEATURE_SCREEN_EXCLUDE_FROM_CAPTURE:
return true; 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: case FEATURE_EMOJI_AND_SYMBOL_PICKER:
return (os_ver.dwBuildNumber >= 17134); // Windows 10 Redstone 4 (1803)+ only. return (os_ver.dwBuildNumber >= 17134); // Windows 10 Redstone 4 (1803)+ only.
#ifdef ACCESSKIT_ENABLED #ifdef ACCESSKIT_ENABLED

View file

@ -639,7 +639,7 @@ String OS_Windows::get_version_alias() const {
} else { } else {
windows_string += "Unknown"; 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); return vformat("%s (build %d)", windows_string, (int64_t)fow.dwBuildNumber);
} }