summaryrefslogtreecommitdiff
path: root/Userland/Applications/DisplaySettings
diff options
context:
space:
mode:
authorGunnar Beutner <gbeutner@serenityos.org>2021-05-03 13:33:59 +0200
committerAndreas Kling <kling@serenityos.org>2021-05-03 21:14:40 +0200
commit5bb79ea0a79322d944368825ec617ccfb8912b81 (patch)
tree120c86845f8285f398000386722d0a7cda312440 /Userland/Applications/DisplaySettings
parent78803ce384d62c40958cc8191a036307f5d8bc9f (diff)
downloadserenity-5bb79ea0a79322d944368825ec617ccfb8912b81.zip
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.
Diffstat (limited to 'Userland/Applications/DisplaySettings')
-rw-r--r--Userland/Applications/DisplaySettings/DisplaySettings.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Applications/DisplaySettings/DisplaySettings.cpp b/Userland/Applications/DisplaySettings/DisplaySettings.cpp
index 7c80bac763..42443fc0d4 100644
--- a/Userland/Applications/DisplaySettings/DisplaySettings.cpp
+++ b/Userland/Applications/DisplaySettings/DisplaySettings.cpp
@@ -264,9 +264,9 @@ void DisplaySettingsWidget::send_settings_to_window_server()
}
if (current_resolution != m_monitor_widget->desktop_resolution() || current_scale_factor != m_monitor_widget->desktop_scale_factor()) {
- auto result = GUI::WindowServerConnection::the().send_sync<Messages::WindowServer::SetResolution>(m_monitor_widget->desktop_resolution(), m_monitor_widget->desktop_scale_factor());
- if (!result->success()) {
- GUI::MessageBox::show(nullptr, String::formatted("Reverting to resolution {}x{} @ {}x", result->resolution().width(), result->resolution().height(), result->scale_factor()),
+ auto result = GUI::WindowServerConnection::the().set_resolution(m_monitor_widget->desktop_resolution(), m_monitor_widget->desktop_scale_factor());
+ if (!result.success()) {
+ GUI::MessageBox::show(nullptr, String::formatted("Reverting to resolution {}x{} @ {}x", result.resolution().width(), result.resolution().height(), result.scale_factor()),
"Unable to set resolution", GUI::MessageBox::Type::Error);
} else {
auto box = GUI::MessageBox::construct(window(), String::formatted("Do you want to keep the new settings? They will be reverted after 10 seconds."),
@@ -282,9 +282,9 @@ void DisplaySettingsWidget::send_settings_to_window_server()
// If the user selects "No", closes the window or the window gets closed by the 10 seconds timer, revert the changes.
if (box->exec() != GUI::MessageBox::ExecYes) {
- result = GUI::WindowServerConnection::the().send_sync<Messages::WindowServer::SetResolution>(current_resolution, current_scale_factor);
- if (!result->success()) {
- GUI::MessageBox::show(nullptr, String::formatted("Reverting to resolution {}x{} @ {}x", result->resolution().width(), result->resolution().height(), result->scale_factor()),
+ result = GUI::WindowServerConnection::the().set_resolution(current_resolution, current_scale_factor);
+ if (!result.success()) {
+ GUI::MessageBox::show(nullptr, String::formatted("Reverting to resolution {}x{} @ {}x", result.resolution().width(), result.resolution().height(), result.scale_factor()),
"Unable to set resolution", GUI::MessageBox::Type::Error);
}
}