From 814195b060818ad4e46653d5ad5ff9834adc216b Mon Sep 17 00:00:00 2001 From: Tom Date: Sun, 4 Jul 2021 11:18:11 -0600 Subject: [PATCH] WindowServer: Only run window animation for windows on current desktop We should only run the minimize and launch animations for windows that are actually rendered on the currently visible virtual desktop. --- Userland/Services/WindowServer/Window.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Userland/Services/WindowServer/Window.cpp b/Userland/Services/WindowServer/Window.cpp index f59091d099..b5f52d9006 100644 --- a/Userland/Services/WindowServer/Window.cpp +++ b/Userland/Services/WindowServer/Window.cpp @@ -342,6 +342,8 @@ static Gfx::IntRect interpolate_rect(Gfx::IntRect const& from_rect, Gfx::IntRect void Window::start_minimize_animation() { + if (&window_stack() != &WindowManager::the().current_window_stack()) + return; if (!m_have_taskbar_rect) { // If this is a modal window, it may not have its own taskbar // button, so there is no rectangle. In that case, walk the @@ -385,6 +387,9 @@ void Window::start_minimize_animation() void Window::start_launch_animation(Gfx::IntRect const& launch_origin_rect) { + if (&window_stack() != &WindowManager::the().current_window_stack()) + return; + m_animation = Animation::create(); m_animation->set_duration(150); m_animation->on_update = [this, launch_origin_rect](float progress, Gfx::Painter& painter, Screen& screen, Gfx::DisjointRectSet& flush_rects) {