summaryrefslogtreecommitdiff
path: root/WindowServer/WSMessageLoop.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-02-13 18:48:22 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-02-13 18:49:23 +0100
commitcf432b4c3d366edef40798a777ab2014715fd7f4 (patch)
treeeb8e817191dc090a024ecaf1d6bab3b85b6ed470 /WindowServer/WSMessageLoop.cpp
parentfbbf57b61c34e548159f70d496dec2b0fbc54545 (diff)
downloadserenity-cf432b4c3d366edef40798a777ab2014715fd7f4.zip
WindowServer: Refactor more of the menu APIs to be message-based.
This is all pretty verbose but I can whittle it down later. :^)
Diffstat (limited to 'WindowServer/WSMessageLoop.cpp')
-rw-r--r--WindowServer/WSMessageLoop.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/WindowServer/WSMessageLoop.cpp b/WindowServer/WSMessageLoop.cpp
index 2c1659eb6c..a786a963ea 100644
--- a/WindowServer/WSMessageLoop.cpp
+++ b/WindowServer/WSMessageLoop.cpp
@@ -274,6 +274,19 @@ ssize_t WSMessageLoop::on_receive_from_client(int client_id, const byte* data, s
case GUI_ClientMessage::Type::DestroyMenubar:
post_message(&WSWindowManager::the(), make<WSAPIDestroyMenubarRequest>(client_id, message.menu.menubar_id));
break;
+ case GUI_ClientMessage::Type::SetApplicationMenubar:
+ post_message(&WSWindowManager::the(), make<WSAPISetApplicationMenubarRequest>(client_id, message.menu.menubar_id));
+ break;
+ case GUI_ClientMessage::Type::AddMenuToMenubar:
+ post_message(&WSWindowManager::the(), make<WSAPIAddMenuToMenubarRequest>(client_id, message.menu.menubar_id, message.menu.menu_id));
+ break;
+ case GUI_ClientMessage::Type::CreateMenu:
+ ASSERT(message.menu.text_length < sizeof(message.menu.text));
+ post_message(&WSWindowManager::the(), make<WSAPICreateMenuRequest>(client_id, String(message.menu.text, message.menu.text_length)));
+ break;
+ case GUI_ClientMessage::Type::DestroyMenu:
+ post_message(&WSWindowManager::the(), make<WSAPIDestroyMenuRequest>(client_id, message.menu.menu_id));
+ break;
}
return size;
}