mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:07:44 +00:00
LibGUI+WindowServer: Don't use a WM IPC to initiate own window resize
The WM_* IPC messages are intended for "outsider" window management, not for a client's own windows. Make a separate StartWindowResize message for this. This was the only reason that every IPC client had to know its server side client ID.
This commit is contained in:
parent
c41d340983
commit
a5bbe3280d
6 changed files with 20 additions and 4 deletions
|
@ -673,6 +673,19 @@ void ClientConnection::handle(const Messages::WindowServer::WM_PopupWindowMenu&
|
|||
}
|
||||
}
|
||||
|
||||
void ClientConnection::handle(const Messages::WindowServer::StartWindowResize& request)
|
||||
{
|
||||
auto it = m_windows.find(request.window_id());
|
||||
if (it == m_windows.end()) {
|
||||
did_misbehave("WM_StartWindowResize: Bad window ID");
|
||||
return;
|
||||
}
|
||||
auto& window = *(*it).value;
|
||||
// FIXME: We are cheating a bit here by using the current cursor location and hard-coding the left button.
|
||||
// Maybe the client should be allowed to specify what initiated this request?
|
||||
WindowManager::the().start_window_resize(window, Screen::the().cursor_location(), MouseButton::Left);
|
||||
}
|
||||
|
||||
void ClientConnection::handle(const Messages::WindowServer::WM_StartWindowResize& request)
|
||||
{
|
||||
auto* client = ClientConnection::from_client_id(request.client_id());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue