diff options
author | Tom <tomut@yahoo.com> | 2021-07-04 11:18:11 -0600 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-07-04 20:23:56 +0200 |
commit | 814195b060818ad4e46653d5ad5ff9834adc216b (patch) | |
tree | 359a3407ebd89589b1e493ad7065dd9df6ca4ed7 /Userland/Services | |
parent | 812ee194b72804cbc20848fd562d6c9b4f172bf7 (diff) | |
download | serenity-814195b060818ad4e46653d5ad5ff9834adc216b.zip |
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.
Diffstat (limited to 'Userland/Services')
-rw-r--r-- | Userland/Services/WindowServer/Window.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
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) { |