mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-27 01:50:24 +00:00
d111b6ead4
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. :^)
28 lines
820 B
C++
28 lines
820 B
C++
#include "TaskbarButton.h"
|
|
#include <LibGUI/GAction.h>
|
|
#include <LibGUI/GWindowServerConnection.h>
|
|
|
|
TaskbarButton::TaskbarButton(const WindowIdentifier& identifier, GWidget* parent)
|
|
: GButton(parent)
|
|
, m_identifier(identifier)
|
|
{
|
|
}
|
|
|
|
TaskbarButton::~TaskbarButton()
|
|
{
|
|
}
|
|
|
|
void TaskbarButton::context_menu_event(GContextMenuEvent&)
|
|
{
|
|
GWindowServerConnection::the().post_message(WindowServer::WM_PopupWindowMenu(m_identifier.client_id(), m_identifier.window_id(), screen_relative_rect().location()));
|
|
}
|
|
|
|
void TaskbarButton::resize_event(GResizeEvent& event)
|
|
{
|
|
GWindowServerConnection::the().post_message(
|
|
WindowServer::WM_SetWindowTaskbarRect(
|
|
m_identifier.client_id(),
|
|
m_identifier.window_id(),
|
|
screen_relative_rect()));
|
|
return GButton::resize_event(event);
|
|
}
|