From 9734feb44917c6c64530c34a0c36defe9dbff472 Mon Sep 17 00:00:00 2001 From: Riteo Date: Sat, 25 May 2024 14:11:52 +0200 Subject: [PATCH] Wayland: Implement is_window_transparency_available --- platform/linuxbsd/wayland/display_server_wayland.cpp | 9 +++++++++ platform/linuxbsd/wayland/display_server_wayland.h | 2 ++ 2 files changed, 11 insertions(+) diff --git a/platform/linuxbsd/wayland/display_server_wayland.cpp b/platform/linuxbsd/wayland/display_server_wayland.cpp index ce8a53a856c0..7a81e6a425e9 100644 --- a/platform/linuxbsd/wayland/display_server_wayland.cpp +++ b/platform/linuxbsd/wayland/display_server_wayland.cpp @@ -1209,6 +1209,15 @@ void DisplayServerWayland::set_context(Context p_context) { wayland_thread.window_set_app_id(MAIN_WINDOW_ID, app_id); } +bool DisplayServerWayland::is_window_transparency_available() const { +#if defined(RD_ENABLED) + if (rendering_device && !rendering_device->is_composite_alpha_supported()) { + return false; + } +#endif + return OS::get_singleton()->is_layered_allowed(); +} + Vector DisplayServerWayland::get_rendering_drivers_func() { Vector drivers; diff --git a/platform/linuxbsd/wayland/display_server_wayland.h b/platform/linuxbsd/wayland/display_server_wayland.h index 38ecbd703d4d..c24eb0ee6262 100644 --- a/platform/linuxbsd/wayland/display_server_wayland.h +++ b/platform/linuxbsd/wayland/display_server_wayland.h @@ -280,6 +280,8 @@ class DisplayServerWayland : public DisplayServer { virtual void set_context(Context p_context) override; + virtual bool is_window_transparency_available() const override; + static DisplayServer *create_func(const String &p_rendering_driver, WindowMode p_mode, VSyncMode p_vsync_mode, uint32_t p_flags, const Point2i *p_position, const Size2i &p_resolution, int p_screen, Context p_context, Error &r_error); static Vector get_rendering_drivers_func();