ladybird/Applications/Taskbar/TaskbarButton.cpp
Robin Burchell 2177594c96 Port LibGUI to use CIPCClientSideConnection
As a consequence, move to use an explicit handshake() method rather than
calling virtuals from the constructor. This seemed to not bother
AClientConnection, but LibGUI crashes (rightfully) because of it.
2019-07-17 20:16:44 +02:00

24 lines
702 B
C++

#include "TaskbarButton.h"
#include <LibGUI/GAction.h>
#include <LibGUI/GEventLoop.h>
#include <WindowServer/WSAPITypes.h>
TaskbarButton::TaskbarButton(const WindowIdentifier& identifier, GWidget* parent)
: GButton(parent)
, m_identifier(identifier)
{
}
TaskbarButton::~TaskbarButton()
{
}
void TaskbarButton::context_menu_event(GContextMenuEvent&)
{
WSAPI_ClientMessage request;
request.type = WSAPI_ClientMessage::Type::WM_PopupWindowMenu;
request.wm.client_id = m_identifier.client_id();
request.wm.window_id = m_identifier.window_id();
request.wm.position = screen_relative_rect().location();
GEventLoop::current().connection().post_message_to_server(request);
}