mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:07:36 +00:00
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
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
Add a link
Reference in a new issue