summaryrefslogtreecommitdiff
path: root/Userland/Applications/DisplaySettings
diff options
context:
space:
mode:
authorkleines Filmröllchen <filmroellchen@serenityos.org>2022-03-31 18:49:26 +0200
committerLinus Groh <mail@linusgroh.de>2022-04-21 13:41:55 +0200
commitbe98ce0f9fac36a646079c6729c643ee1b2ad420 (patch)
treee0ecfb7b009eec78fa863713b0a7af06d5bcec67 /Userland/Applications/DisplaySettings
parente95ae4a1431039fbb34a09b274f3ebf096609a2a (diff)
downloadserenity-be98ce0f9fac36a646079c6729c643ee1b2ad420.zip
WindowServer: Add the screen mode property in the screen configuration
This will allow us to change between a couple of properties, for now it's only Device and Virtual. (How about Remote :^) ) These get handled by a different screen backend in the Screen.
Diffstat (limited to 'Userland/Applications/DisplaySettings')
-rw-r--r--Userland/Applications/DisplaySettings/MonitorSettingsWidget.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/Userland/Applications/DisplaySettings/MonitorSettingsWidget.cpp b/Userland/Applications/DisplaySettings/MonitorSettingsWidget.cpp
index e3de3f8029..7d384a1b59 100644
--- a/Userland/Applications/DisplaySettings/MonitorSettingsWidget.cpp
+++ b/Userland/Applications/DisplaySettings/MonitorSettingsWidget.cpp
@@ -144,14 +144,22 @@ void MonitorSettingsWidget::load_current_settings()
m_screens.clear();
m_screen_edids.clear();
+
+ size_t virtual_screen_count = 0;
for (size_t i = 0; i < m_screen_layout.screens.size(); i++) {
String screen_display_name;
- if (auto edid = EDID::Parser::from_framebuffer_device(m_screen_layout.screens[i].device, 0); !edid.is_error()) { // TODO: multihead
- screen_display_name = display_name_from_edid(edid.value());
- m_screen_edids.append(edid.release_value());
+ if (m_screen_layout.screens[i].mode == WindowServer::ScreenLayout::Screen::Mode::Device) {
+ if (auto edid = EDID::Parser::from_framebuffer_device(m_screen_layout.screens[i].device.value(), 0); !edid.is_error()) { // TODO: multihead
+ screen_display_name = display_name_from_edid(edid.value());
+ m_screen_edids.append(edid.release_value());
+ } else {
+ dbgln("Error getting EDID from device {}: {}", m_screen_layout.screens[i].device.value(), edid.error());
+ screen_display_name = m_screen_layout.screens[i].device.value();
+ m_screen_edids.append({});
+ }
} else {
- dbgln("Error getting EDID from device {}: {}", m_screen_layout.screens[i].device, edid.error());
- screen_display_name = m_screen_layout.screens[i].device;
+ dbgln("Frame buffer {} is virtual.", i);
+ screen_display_name = String::formatted("Virtual screen {}", virtual_screen_count++);
m_screen_edids.append({});
}
if (i == m_screen_layout.main_screen_index)