
Taskbar now simply asks the WindowServer to popup a window menu when right clicking on a taskbar button. This patch also implements the "close" menu item, and furthermore makes the window menu show up when you left-click a window's titlebar icon. :^)
24 lines
679 B
C++
24 lines
679 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::post_message_to_server(request);
|
|
}
|