summaryrefslogtreecommitdiffstats
path: root/platform/windows/display_server_windows.cpp
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2024-05-03 11:48:46 +0300
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2024-05-23 15:23:18 +0300
commit628c81d2d9a2cf05541a8d95dd99f6349aca851d (patch)
treef0063c0a9125e9a6a9562e572429e38efbbb2372 /platform/windows/display_server_windows.cpp
parentb947c53ddc08d4314b2ce70ca1bc2adb37b83c37 (diff)
downloadredot-engine-628c81d2d9a2cf05541a8d95dd99f6349aca851d.tar.gz
[DisplayServer] Add method to check if window transparency is supported and enabled.
Diffstat (limited to 'platform/windows/display_server_windows.cpp')
-rw-r--r--platform/windows/display_server_windows.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp
index 6ee35d4fbd..b84e1f8eea 100644
--- a/platform/windows/display_server_windows.cpp
+++ b/platform/windows/display_server_windows.cpp
@@ -3401,6 +3401,19 @@ DisplayServer::VSyncMode DisplayServerWindows::window_get_vsync_mode(WindowID p_
void DisplayServerWindows::set_context(Context p_context) {
}
+bool DisplayServerWindows::is_window_transparency_available() const {
+ BOOL dwm_enabled = true;
+ if (DwmIsCompositionEnabled(&dwm_enabled) == S_OK) { // Note: Always enabled on Windows 8+, this check can be removed after Windows 7 support is dropped.
+ if (!dwm_enabled) {
+ return false;
+ }
+ }
+ if (rendering_device && !rendering_device->is_composite_alpha_supported()) {
+ return false;
+ }
+ return OS::get_singleton()->is_layered_allowed();
+}
+
#define MI_WP_SIGNATURE 0xFF515700
#define SIGNATURE_MASK 0xFFFFFF00
// Keeping the name suggested by Microsoft, but this macro really answers: