Browse Source

DisplaySettings: Capitalize fallback display mode when loading settings

This setting was capitalized a while ago, except for this place where
we fall back to "[C]center". This caused a crash in MonitorWidget.
Julian Offenhäuser 2 years ago
parent
commit
ab5b61c3fe

+ 3 - 3
Userland/Applications/DisplaySettings/BackgroundSettingsWidget.cpp

@@ -130,10 +130,10 @@ void BackgroundSettingsWidget::load_current_settings()
         m_monitor_widget->set_wallpaper(selected_wallpaper);
     }
 
-    auto mode = ws_config->read_entry("Background", "Mode", "center");
+    auto mode = ws_config->read_entry("Background", "Mode", "Center");
     if (!m_modes.contains_slow(mode)) {
-        warnln("Invalid background mode '{}' in WindowServer config, falling back to 'center'", mode);
-        mode = "center";
+        warnln("Invalid background mode '{}' in WindowServer config, falling back to 'Center'", mode);
+        mode = "Center";
     }
     m_monitor_widget->set_wallpaper_mode(mode);
     m_mode_combo->set_selected_index(m_modes.find_first_index(mode).value_or(0), GUI::AllowCallback::No);