diff --git a/core/os/os.h b/core/os/os.h index 4f6a539e786..b128e6424c0 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -104,7 +104,6 @@ public: bool maximized; bool always_on_top; bool use_vsync; - bool layered_splash; bool layered; float get_aspect() const { return (float)width / (float)height; } VideoMode(int p_width = 1024, int p_height = 600, bool p_fullscreen = false, bool p_resizable = true, bool p_borderless_window = false, bool p_maximized = false, bool p_always_on_top = false, bool p_use_vsync = false) { @@ -117,7 +116,6 @@ public: always_on_top = p_always_on_top; use_vsync = p_use_vsync; layered = false; - layered_splash = false; } }; diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index f7cd6c3e83a..2592bc67757 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -818,6 +818,7 @@ If [code]true[/code], removes the window frame. + Note: Setting [code]window_borderless[/code] to [code]false[/code] disables per-pixel transparency. If [code]true[/code], the window is fullscreen. @@ -829,6 +830,9 @@ If [code]true[/code], the window is minimized. + If [code]true[/code], the window background is transparent and window frame is removed. + Use [code]get_tree().get_root().set_transparent_background(true)[/code] to disable main viewport background rendering. + Note: This property has no effect if "Project > Project Settings > Display > Window > Per-pixel transparency > Allowed" setting is disabled. The window position relative to the screen, the origin is the top left corner, +Y axis goes to the bottom and +X axis goes to the right. diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 460db5e7924..196fcbfaaae 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -374,11 +374,10 @@ Default orientation on mobile devices. - If [code]true[/code], allows per-pixel transparency in a desktop window. This affects performance if not needed, so leave it on [code]false[/code] unless you need it. + If [code]true[/code], allows per-pixel transparency in a desktop window. This affects performance, so leave it on [code]false[/code] unless you need it. - - + Set the window background to transparent when it starts. Force the window to be always on top. diff --git a/main/main.cpp b/main/main.cpp index 14ef2575268..3f01a17ea7c 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -939,7 +939,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph OS::get_singleton()->_allow_layered = GLOBAL_DEF("display/window/per_pixel_transparency/allowed", false); video_mode.layered = GLOBAL_DEF("display/window/per_pixel_transparency/enabled", false); - video_mode.layered_splash = GLOBAL_DEF("display/window/per_pixel_transparency/splash", false); GLOBAL_DEF("rendering/quality/intended_usage/framebuffer_allocation", 2); GLOBAL_DEF("rendering/quality/intended_usage/framebuffer_allocation.mobile", 3); diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 567d24de3ee..fea9b908662 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -1551,7 +1551,7 @@ Error OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_a restore_rect = Rect2(get_window_position(), get_window_size()); - if (p_desired.layered_splash) { + if (p_desired.layered) { set_window_per_pixel_transparency_enabled(true); } return OK; diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 6df2ad48211..4cd637a4b27 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -1381,7 +1381,7 @@ Error OS_Windows::initialize(const VideoMode &p_desired, int p_video_driver, int SetFocus(hWnd); // Sets Keyboard Focus To } - if (p_desired.layered_splash) { + if (p_desired.layered) { set_window_per_pixel_transparency_enabled(true); } diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 494ae412203..510f3d6114c 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -593,7 +593,7 @@ Error OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_a power_manager = memnew(PowerX11); - if (p_desired.layered_splash) { + if (p_desired.layered) { set_window_per_pixel_transparency_enabled(true); }