1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:17:45 +00:00

WindowServer+Taskbar: Animate window frames on minimize/unminimize

We now show a quick window outline animation when going in/out of
minimized state. It's a simple 10 frame animation at 60fps, just to
give a visual cue of what's happening with the window.

The Taskbar sends over the corresponding button rect for each window
to the WindowServer using a new WM_SetWindowTaskbarRect message.

Note that when unminimizing, we still *show* the window right away,
and don't hold off until the animation has finished. This avoids
making the desktop feel slow/sluggish. :^)
This commit is contained in:
Andreas Kling 2019-12-03 21:34:34 +01:00
parent 51262e7e2d
commit d111b6ead4
8 changed files with 78 additions and 0 deletions

View file

@ -612,3 +612,19 @@ bool WSClientConnection::is_showing_modal_window() const
}
return false;
}
void WSClientConnection::handle(const WindowServer::WM_SetWindowTaskbarRect& message)
{
auto* client = WSClientConnection::from_client_id(message.client_id());
if (!client) {
did_misbehave("WM_SetWindowTaskbarRect: Bad client ID");
return;
}
auto it = client->m_windows.find(message.window_id());
if (it == client->m_windows.end()) {
did_misbehave("WM_SetWindowTaskbarRect: Bad window ID");
return;
}
auto& window = *(*it).value;
window.set_taskbar_rect(message.rect());
}