summaryrefslogtreecommitdiff
path: root/Userland/Services
diff options
context:
space:
mode:
authorTom <tomut@yahoo.com>2021-02-11 17:32:03 -0700
committerAndreas Kling <kling@serenityos.org>2021-02-12 08:57:42 +0100
commit7e06afb82270266d8501386b8907f6017186f418 (patch)
tree3961463009a7a1557421151283db757e2fc7feab /Userland/Services
parentc2de22a635812c54621b1416e23fbff73580c103 (diff)
downloadserenity-7e06afb82270266d8501386b8907f6017186f418.zip
WindowServer: Recompute occlusions when changing window's alpha channel
Fixes #4845
Diffstat (limited to 'Userland/Services')
-rw-r--r--Userland/Services/WindowServer/Window.cpp10
-rw-r--r--Userland/Services/WindowServer/Window.h2
2 files changed, 10 insertions, 2 deletions
diff --git a/Userland/Services/WindowServer/Window.cpp b/Userland/Services/WindowServer/Window.cpp
index 0a28629e16..544d19ee49 100644
--- a/Userland/Services/WindowServer/Window.cpp
+++ b/Userland/Services/WindowServer/Window.cpp
@@ -323,10 +323,18 @@ void Window::set_opacity(float opacity)
m_opacity = opacity;
if (was_opaque != is_opaque())
Compositor::the().invalidate_occlusions();
- Compositor::the().invalidate_screen(frame().render_rect());
+ invalidate(false);
WindowManager::the().notify_opacity_changed(*this);
}
+void Window::set_has_alpha_channel(bool value)
+{
+ if (m_has_alpha_channel == value)
+ return;
+ m_has_alpha_channel = value;
+ Compositor::the().invalidate_occlusions();
+}
+
void Window::set_occluded(bool occluded)
{
if (m_occluded == occluded)
diff --git a/Userland/Services/WindowServer/Window.h b/Userland/Services/WindowServer/Window.h
index 02de18c0bd..53c39a1524 100644
--- a/Userland/Services/WindowServer/Window.h
+++ b/Userland/Services/WindowServer/Window.h
@@ -219,7 +219,7 @@ public:
bool global_cursor_tracking() const { return m_global_cursor_tracking_enabled || m_automatic_cursor_tracking_enabled; }
bool has_alpha_channel() const { return m_has_alpha_channel; }
- void set_has_alpha_channel(bool value) { m_has_alpha_channel = value; }
+ void set_has_alpha_channel(bool value);
Gfx::IntSize size_increment() const { return m_size_increment; }
void set_size_increment(const Gfx::IntSize& increment) { m_size_increment = increment; }