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.
This commit is contained in:
parent
812ee194b7
commit
814195b060
Notes:
sideshowbarker
2024-07-18 10:29:29 +09:00
Author: https://github.com/tomuta Commit: https://github.com/SerenityOS/serenity/commit/814195b0608 Pull-request: https://github.com/SerenityOS/serenity/pull/8436
1 changed files with 5 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue