DisplaySettings: Update wallpaper config path only on success
The Window Server is ignoring incorrect files since 235f39e449
, so let's
not update the config when that happens and an error message instead!
This commit is contained in:
parent
e56ffd11ce
commit
20191b58e2
Notes:
sideshowbarker
2024-07-18 00:39:41 +09:00
Author: https://github.com/krkk Commit: https://github.com/SerenityOS/serenity/commit/20191b58e2e Pull-request: https://github.com/SerenityOS/serenity/pull/11001
1 changed files with 5 additions and 3 deletions
|
@ -20,6 +20,7 @@
|
|||
#include <LibGUI/FileSystemModel.h>
|
||||
#include <LibGUI/IconView.h>
|
||||
#include <LibGUI/ItemListModel.h>
|
||||
#include <LibGUI/MessageBox.h>
|
||||
#include <LibGUI/WindowServerConnection.h>
|
||||
#include <LibGfx/Palette.h>
|
||||
#include <LibGfx/SystemTheme.h>
|
||||
|
@ -139,11 +140,12 @@ void BackgroundSettingsWidget::load_current_settings()
|
|||
|
||||
void BackgroundSettingsWidget::apply_settings()
|
||||
{
|
||||
Config::write_string("WindowManager", "Background", "Wallpaper", m_monitor_widget->wallpaper());
|
||||
if (GUI::Desktop::the().set_wallpaper(m_monitor_widget->wallpaper()))
|
||||
Config::write_string("WindowManager", "Background", "Wallpaper", m_monitor_widget->wallpaper());
|
||||
else
|
||||
GUI::MessageBox::show_error(window(), String::formatted("Unable to load file {} as wallpaper", m_monitor_widget->wallpaper()));
|
||||
|
||||
GUI::Desktop::the().set_wallpaper(m_monitor_widget->wallpaper());
|
||||
GUI::Desktop::the().set_background_color(m_color_input->text());
|
||||
|
||||
GUI::Desktop::the().set_wallpaper_mode(m_monitor_widget->wallpaper_mode());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue