summaryrefslogtreecommitdiff
path: root/Services
diff options
context:
space:
mode:
authorHüseyin ASLITÜRK <asliturk@hotmail.com>2020-06-18 13:14:00 +0300
committerAndreas Kling <kling@serenityos.org>2020-06-18 23:18:11 +0200
commit5950736efaf4d1434bdabc17ad23ee82830bc58b (patch)
tree33dc16e47e9a3c5f91142abe9ea259da0710439e /Services
parent5bd0015583017a77ff8d32c537306c3b830457f3 (diff)
downloadserenity-5950736efaf4d1434bdabc17ad23ee82830bc58b.zip
WindowServer: Add a new IsMaximized message
New message to query window maximized state.
Diffstat (limited to 'Services')
-rw-r--r--Services/WindowServer/ClientConnection.cpp10
-rw-r--r--Services/WindowServer/ClientConnection.h1
-rw-r--r--Services/WindowServer/WindowServer.ipc2
3 files changed, 13 insertions, 0 deletions
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<Messages::WindowServer::GetWindowTitleResponse> ClientConnection::handle(
return make<Messages::WindowServer::GetWindowTitleResponse>(it->value->title());
}
+OwnPtr<Messages::WindowServer::IsMaximizedResponse> 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<Messages::WindowServer::IsMaximizedResponse>(it->value->is_minimized());
+}
+
OwnPtr<Messages::WindowServer::SetWindowIconBitmapResponse> 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<Messages::WindowServer::DestroyWindowResponse> handle(const Messages::WindowServer::DestroyWindow&) override;
virtual OwnPtr<Messages::WindowServer::SetWindowTitleResponse> handle(const Messages::WindowServer::SetWindowTitle&) override;
virtual OwnPtr<Messages::WindowServer::GetWindowTitleResponse> handle(const Messages::WindowServer::GetWindowTitle&) override;
+ virtual OwnPtr<Messages::WindowServer::IsMaximizedResponse> handle(const Messages::WindowServer::IsMaximized&) override;
virtual OwnPtr<Messages::WindowServer::SetWindowRectResponse> handle(const Messages::WindowServer::SetWindowRect&) override;
virtual OwnPtr<Messages::WindowServer::GetWindowRectResponse> 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<Gfx::IntRect> rects, bool ignore_occlusion) =|
DidFinishPainting(i32 window_id, Vector<Gfx::IntRect> rects) =|