mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 06:45:07 +00:00

This was a mistake, of course. Nested event loops don't need (or want) independent server connections. We initialize the connection early in GEventLoop for e.g. users that want to get the size of a GDesktop before the connection has been established. Bug noticed by Andreas, introduced by me ;-)
24 lines
698 B
C++
24 lines
698 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();
|
|
GWindowServerConnection::the().post_message_to_server(request);
|
|
}
|