From 5950736efaf4d1434bdabc17ad23ee82830bc58b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20ASLIT=C3=9CRK?= Date: Thu, 18 Jun 2020 13:14:00 +0300 Subject: [PATCH] WindowServer: Add a new IsMaximized message New message to query window maximized state. --- Services/WindowServer/ClientConnection.cpp | 10 ++++++++++ Services/WindowServer/ClientConnection.h | 1 + Services/WindowServer/WindowServer.ipc | 2 ++ 3 files changed, 13 insertions(+) diff --git a/Services/WindowServer/ClientConnection.cpp b/Services/WindowServer/ClientConnection.cpp index 56353cda36..ffada938af 100644 --- a/Services/WindowServer/ClientConnection.cpp +++ b/Services/WindowServer/ClientConnection.cpp @@ -361,6 +361,16 @@ OwnPtr ClientConnection::handle( return make(it->value->title()); } +OwnPtr ClientConnection::handle(const Messages::WindowServer::IsMaximized& message) +{ + auto it = m_windows.find(message.window_id()); + if (it == m_windows.end()) { + did_misbehave("IsMaximized: Bad window ID"); + return nullptr; + } + return make(it->value->is_minimized()); +} + OwnPtr ClientConnection::handle(const Messages::WindowServer::SetWindowIconBitmap& message) { auto it = m_windows.find(message.window_id()); diff --git a/Services/WindowServer/ClientConnection.h b/Services/WindowServer/ClientConnection.h index ea4d822d55..0ca52c1531 100644 --- a/Services/WindowServer/ClientConnection.h +++ b/Services/WindowServer/ClientConnection.h @@ -108,6 +108,7 @@ private: virtual OwnPtr handle(const Messages::WindowServer::DestroyWindow&) override; virtual OwnPtr handle(const Messages::WindowServer::SetWindowTitle&) override; virtual OwnPtr handle(const Messages::WindowServer::GetWindowTitle&) override; + virtual OwnPtr handle(const Messages::WindowServer::IsMaximized&) override; virtual OwnPtr handle(const Messages::WindowServer::SetWindowRect&) override; virtual OwnPtr handle(const Messages::WindowServer::GetWindowRect&) override; virtual void handle(const Messages::WindowServer::InvalidateRect&) override; diff --git a/Services/WindowServer/WindowServer.ipc b/Services/WindowServer/WindowServer.ipc index 128fdb83c0..3e3801247f 100644 --- a/Services/WindowServer/WindowServer.ipc +++ b/Services/WindowServer/WindowServer.ipc @@ -54,6 +54,8 @@ endpoint WindowServer = 2 SetWindowRect(i32 window_id, Gfx::IntRect rect) => (Gfx::IntRect rect) GetWindowRect(i32 window_id) => (Gfx::IntRect rect) + IsMaximized(i32 window_id) => (bool maximized) + InvalidateRect(i32 window_id, Vector rects, bool ignore_occlusion) =| DidFinishPainting(i32 window_id, Vector rects) =|