From 7beae405085cffb74ab5218b74b061b3af61783f Mon Sep 17 00:00:00 2001 From: Liav A Date: Thu, 27 Feb 2020 17:20:56 +0200 Subject: [PATCH] DisplayProperties: Warn user about failed resolution setting Also, we have now two new resolutions - 1368x768 and 1366x768. The 1366x768 resolution is currently not supported but is good for testing a failed resolution setting. --- Applications/DisplayProperties/DisplayProperties.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Applications/DisplayProperties/DisplayProperties.cpp b/Applications/DisplayProperties/DisplayProperties.cpp index 51041bce99..225457c83a 100644 --- a/Applications/DisplayProperties/DisplayProperties.cpp +++ b/Applications/DisplayProperties/DisplayProperties.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -62,6 +63,8 @@ void DisplayPropertiesWidget::create_resolution_list() m_resolutions.append({ 800, 600 }); m_resolutions.append({ 1024, 768 }); m_resolutions.append({ 1280, 720 }); + m_resolutions.append({ 1368, 768 }); + m_resolutions.append({ 1366, 768 }); m_resolutions.append({ 1280, 1024 }); m_resolutions.append({ 1440, 900 }); m_resolutions.append({ 1600, 900 }); @@ -223,7 +226,9 @@ void DisplayPropertiesWidget::send_settings_to_window_server(int tab_index) GUI::Desktop::the().set_wallpaper(builder.to_string()); } else if (tab_index == TabIndices::Settings) { dbg() << "Attempting to set resolution " << m_selected_resolution; - GUI::WindowServerConnection::the().send_sync(m_selected_resolution); + auto result = GUI::WindowServerConnection::the().send_sync(m_selected_resolution); + if (!result->success()) + GUI::MessageBox::show(String::format("Reverting to resolution %dx%d", result->resolution().width(), result->resolution().height()), String::format("Unable to set resolution"), GUI::MessageBox::Type::Error, GUI::MessageBox::InputType::OK); } else { dbg() << "Invalid tab index " << tab_index; }