diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml
index e6c3911d8afe..1cc4d5877434 100644
--- a/doc/classes/DisplayServer.xml
+++ b/doc/classes/DisplayServer.xml
@@ -3074,7 +3074,8 @@
The window background can be transparent.
[b]Note:[/b] This flag has no effect if [method is_window_transparency_available] returns [code]false[/code].
- [b]Note:[/b] Transparency support is implemented on Android, Linux (X11/Wayland), macOS, and Windows, but availability might vary depending on GPU driver, display manager, and compositor capabilities.
+ [b]Note:[/b] Transparency support is implemented on Linux (X11/Wayland), macOS, and Windows, but availability might vary depending on GPU driver, display manager, and compositor capabilities.
+ [b]Note:[/b] Transparency support is implemented on Android, but can only be enabled via [member ProjectSettings.display/window/per_pixel_transparency/allowed]. This flag has no effect on Android.
The window can't be focused. No-focus window will ignore all input, except mouse clicks.
diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml
index b3077c4536c0..e1dd3f56caff 100644
--- a/doc/classes/ProjectSettings.xml
+++ b/doc/classes/ProjectSettings.xml
@@ -1016,6 +1016,7 @@
If [code]true[/code], enables a window manager hint that the main window background [i]can[/i] be transparent. This does not make the background actually transparent. For the background to be transparent, the root viewport must also be made transparent by enabling [member rendering/viewport/transparent_background].
[b]Note:[/b] To use a transparent splash screen, set [member application/boot_splash/bg_color] to [code]Color(0, 0, 0, 0)[/code].
[b]Note:[/b] This setting has no effect if [member display/window/per_pixel_transparency/allowed] is set to [code]false[/code].
+ [b]Note:[/b] This setting has no effect on Android as transparency is controlled only via [member display/window/per_pixel_transparency/allowed].
Sets the game's main viewport height. On desktop platforms, this is also the initial window height, represented by an indigo-colored rectangle in the 2D editor. Stretch mode settings also use this as a reference when using the [code]canvas_items[/code] or [code]viewport[/code] stretch modes. See also [member display/window/size/viewport_width], [member display/window/size/window_width_override] and [member display/window/size/window_height_override].
diff --git a/platform/android/display_server_android.cpp b/platform/android/display_server_android.cpp
index 99ca44503fc7..7738b25c5e5d 100644
--- a/platform/android/display_server_android.cpp
+++ b/platform/android/display_server_android.cpp
@@ -596,6 +596,7 @@ void DisplayServerAndroid::window_set_flag(DisplayServer::WindowFlags p_flag, bo
}
bool DisplayServerAndroid::window_get_flag(DisplayServer::WindowFlags p_flag, DisplayServer::WindowID p_window) const {
+ ERR_FAIL_COND_V(p_window != MAIN_WINDOW_ID, false);
switch (p_flag) {
case WindowFlags::WINDOW_FLAG_TRANSPARENT:
return is_window_transparency_available();
diff --git a/platform/android/export/export_plugin.cpp b/platform/android/export/export_plugin.cpp
index 8a5d204e3259..8df03e1a9d54 100644
--- a/platform/android/export/export_plugin.cpp
+++ b/platform/android/export/export_plugin.cpp
@@ -1050,7 +1050,7 @@ void EditorExportPlatformAndroid::_write_tmp_manifest(const Ref &p_preset) const {
+bool EditorExportPlatformAndroid::_is_transparency_allowed(const Ref &p_preset) const {
return (bool)get_project_setting(p_preset, "display/window/per_pixel_transparency/allowed");
}
@@ -1062,13 +1062,13 @@ void EditorExportPlatformAndroid::_fix_themes_xml(const Ref
return;
}
- bool should_be_transparent = _should_be_transparent(p_preset);
+ bool transparency_allowed = _is_transparency_allowed(p_preset);
// Default/Reserved theme attributes.
Dictionary main_theme_attributes;
main_theme_attributes["android:windowSwipeToDismiss"] = bool_to_string(p_preset->get("gesture/swipe_to_dismiss"));
- main_theme_attributes["android:windowIsTranslucent"] = bool_to_string(should_be_transparent);
- if (should_be_transparent) {
+ main_theme_attributes["android:windowIsTranslucent"] = bool_to_string(transparency_allowed);
+ if (transparency_allowed) {
main_theme_attributes["android:windowBackground"] = "@android:color/transparent";
}
@@ -1076,7 +1076,7 @@ void EditorExportPlatformAndroid::_fix_themes_xml(const Ref
splash_theme_attributes["android:windowSplashScreenBackground"] = "@mipmap/icon_background";
splash_theme_attributes["windowSplashScreenAnimatedIcon"] = "@mipmap/icon_foreground";
splash_theme_attributes["postSplashScreenTheme"] = "@style/GodotAppMainTheme";
- splash_theme_attributes["android:windowIsTranslucent"] = bool_to_string(should_be_transparent);
+ splash_theme_attributes["android:windowIsTranslucent"] = bool_to_string(transparency_allowed);
Dictionary custom_theme_attributes = p_preset->get("gradle_build/custom_theme_attributes");
@@ -2988,7 +2988,7 @@ bool EditorExportPlatformAndroid::has_valid_project_configuration(const Ref &p_preset, bool p_give_internet, bool p_debug);
- bool _should_be_transparent(const Ref &p_preset) const;
+ bool _is_transparency_allowed(const Ref &p_preset) const;
void _fix_themes_xml(const Ref &p_preset);
diff --git a/platform/android/java/lib/src/org/godotengine/godot/Godot.kt b/platform/android/java/lib/src/org/godotengine/godot/Godot.kt
index ceb4b0aec84d..8e020e5fffa5 100644
--- a/platform/android/java/lib/src/org/godotengine/godot/Godot.kt
+++ b/platform/android/java/lib/src/org/godotengine/godot/Godot.kt
@@ -487,7 +487,9 @@ class Godot private constructor(val context: Context) {
// Check whether the render view should be made transparent
val shouldBeTransparent =
- !isProjectManagerHint() && !isEditorHint() && java.lang.Boolean.parseBoolean(GodotLib.getGlobal("display/window/per_pixel_transparency/allowed"))
+ !isProjectManagerHint() &&
+ !isEditorHint() &&
+ java.lang.Boolean.parseBoolean(GodotLib.getGlobal("display/window/per_pixel_transparency/allowed"))
Log.d(TAG, "Render view should be transparent: $shouldBeTransparent")
renderView = if (usesVulkan()) {
if (meetsVulkanRequirements(context.packageManager)) {