summaryrefslogtreecommitdiff
path: root/Applications
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2020-02-27 17:20:56 +0200
committerAndreas Kling <kling@serenityos.org>2020-02-28 12:16:05 +0100
commit7beae405085cffb74ab5218b74b061b3af61783f (patch)
treee90c1b0e51d170d4a36bda40a78f74f475d3d7fa /Applications
parent151f32b827d779ba0d19f1a38b79350621d8e0f9 (diff)
downloadserenity-7beae405085cffb74ab5218b74b061b3af61783f.zip
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.
Diffstat (limited to 'Applications')
-rw-r--r--Applications/DisplayProperties/DisplayProperties.cpp7
1 files changed, 6 insertions, 1 deletions
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 <LibGUI/GroupBox.h>
#include <LibGUI/Label.h>
#include <LibGUI/ListView.h>
+#include <LibGUI/MessageBox.h>
#include <LibGUI/ScrollBar.h>
#include <LibGUI/Splitter.h>
#include <LibGUI/TabWidget.h>
@@ -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<Messages::WindowServer::SetResolution>(m_selected_resolution);
+ auto result = GUI::WindowServerConnection::the().send_sync<Messages::WindowServer::SetResolution>(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;
}