mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 21:47:45 +00:00
Userland: Update IPC calls to use proxies
This updates all existing code to use the auto-generated client methods instead of post_message/send_sync.
This commit is contained in:
parent
78803ce384
commit
5bb79ea0a7
63 changed files with 303 additions and 316 deletions
|
@ -26,29 +26,26 @@ TaskbarButton::~TaskbarButton()
|
|||
|
||||
void TaskbarButton::context_menu_event(GUI::ContextMenuEvent&)
|
||||
{
|
||||
GUI::WindowManagerServerConnection::the().post_message(
|
||||
Messages::WindowManagerServer::PopupWindowMenu(
|
||||
m_identifier.client_id(),
|
||||
m_identifier.window_id(),
|
||||
screen_relative_rect().location()));
|
||||
GUI::WindowManagerServerConnection::the().async_popup_window_menu(
|
||||
m_identifier.client_id(),
|
||||
m_identifier.window_id(),
|
||||
screen_relative_rect().location());
|
||||
}
|
||||
|
||||
void TaskbarButton::update_taskbar_rect()
|
||||
{
|
||||
GUI::WindowManagerServerConnection::the().post_message(
|
||||
Messages::WindowManagerServer::SetWindowTaskbarRect(
|
||||
m_identifier.client_id(),
|
||||
m_identifier.window_id(),
|
||||
screen_relative_rect()));
|
||||
GUI::WindowManagerServerConnection::the().async_set_window_taskbar_rect(
|
||||
m_identifier.client_id(),
|
||||
m_identifier.window_id(),
|
||||
screen_relative_rect());
|
||||
}
|
||||
|
||||
void TaskbarButton::clear_taskbar_rect()
|
||||
{
|
||||
GUI::WindowManagerServerConnection::the().post_message(
|
||||
Messages::WindowManagerServer::SetWindowTaskbarRect(
|
||||
m_identifier.client_id(),
|
||||
m_identifier.window_id(),
|
||||
{}));
|
||||
GUI::WindowManagerServerConnection::the().async_set_window_taskbar_rect(
|
||||
m_identifier.client_id(),
|
||||
m_identifier.window_id(),
|
||||
{});
|
||||
}
|
||||
|
||||
void TaskbarButton::resize_event(GUI::ResizeEvent& event)
|
||||
|
|
|
@ -164,7 +164,7 @@ void TaskbarWindow::update_applet_area()
|
|||
main_widget()->do_layout();
|
||||
Gfx::IntRect new_rect { {}, m_applet_area_size };
|
||||
new_rect.center_within(m_applet_area_container->screen_relative_rect());
|
||||
GUI::WindowManagerServerConnection::the().send_sync<Messages::WindowManagerServer::SetAppletAreaPosition>(new_rect.location());
|
||||
GUI::WindowManagerServerConnection::the().set_applet_area_position(new_rect.location());
|
||||
}
|
||||
|
||||
NonnullRefPtr<GUI::Button> TaskbarWindow::create_button(const WindowIdentifier& identifier)
|
||||
|
@ -191,9 +191,9 @@ void TaskbarWindow::add_window_button(::Window& window, const WindowIdentifier&
|
|||
// false because window is the modal window's owner (which is not
|
||||
// active)
|
||||
if (window->is_minimized() || !button->is_checked()) {
|
||||
GUI::WindowManagerServerConnection::the().post_message(Messages::WindowManagerServer::SetActiveWindow(identifier.client_id(), identifier.window_id()));
|
||||
GUI::WindowManagerServerConnection::the().async_set_active_window(identifier.client_id(), identifier.window_id());
|
||||
} else {
|
||||
GUI::WindowManagerServerConnection::the().post_message(Messages::WindowManagerServer::SetWindowMinimized(identifier.client_id(), identifier.window_id(), true));
|
||||
GUI::WindowManagerServerConnection::the().async_set_window_minimized(identifier.client_id(), identifier.window_id(), true);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -178,7 +178,7 @@ NonnullRefPtr<GUI::Menu> build_system_menu()
|
|||
quick_sort(g_themes, [](auto& a, auto& b) { return a.name < b.name; });
|
||||
}
|
||||
|
||||
auto current_theme_name = GUI::WindowServerConnection::the().send_sync<Messages::WindowServer::GetSystemTheme>()->theme_name();
|
||||
auto current_theme_name = GUI::WindowServerConnection::the().get_system_theme().theme_name();
|
||||
|
||||
{
|
||||
int theme_identifier = 0;
|
||||
|
@ -186,8 +186,8 @@ NonnullRefPtr<GUI::Menu> build_system_menu()
|
|||
auto action = GUI::Action::create_checkable(theme.name, [theme_identifier](auto&) {
|
||||
auto& theme = g_themes[theme_identifier];
|
||||
dbgln("Theme switched to {} at path {}", theme.name, theme.path);
|
||||
auto response = GUI::WindowServerConnection::the().send_sync<Messages::WindowServer::SetSystemTheme>(theme.path, theme.name);
|
||||
VERIFY(response->success());
|
||||
auto response = GUI::WindowServerConnection::the().set_system_theme(theme.path, theme.name);
|
||||
VERIFY(response.success());
|
||||
});
|
||||
if (theme.name == current_theme_name)
|
||||
action->set_checked(true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue