From 9f7f7e69bb7c20401cd620377db3a1c36b43fca4 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 14 Nov 2021 11:52:47 +0100 Subject: [PATCH] WindowServer: Allow server-internal windows with alpha channel We were not creating backing stores with alpha for server-internal windows. There was no reason for this limitation. --- Userland/Services/WindowServer/Window.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Userland/Services/WindowServer/Window.cpp b/Userland/Services/WindowServer/Window.cpp index 2391eb06e4..1ecc011947 100644 --- a/Userland/Services/WindowServer/Window.cpp +++ b/Userland/Services/WindowServer/Window.cpp @@ -147,7 +147,8 @@ void Window::set_rect(const Gfx::IntRect& rect) if (rect.is_empty()) { m_backing_store = nullptr; } else if (!m_client && (!m_backing_store || old_rect.size() != rect.size())) { - m_backing_store = Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRx8888, m_rect.size()).release_value_but_fixme_should_propagate_errors(); + auto format = has_alpha_channel() ? Gfx::BitmapFormat::BGRA8888 : Gfx::BitmapFormat::BGRx8888; + m_backing_store = Gfx::Bitmap::try_create(format, m_rect.size()).release_value_but_fixme_should_propagate_errors(); } invalidate(true, old_rect.size() != rect.size());