From 92f4408d66761272ef74862cf7a0f4c78f4d4375 Mon Sep 17 00:00:00 2001 From: Karol Kosek Date: Sun, 8 May 2022 01:16:53 +0200 Subject: [PATCH] DisplaySettings: Make the copy action copy the background path as url Closes: #13907 --- .../DisplaySettings/BackgroundSettingsWidget.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Userland/Applications/DisplaySettings/BackgroundSettingsWidget.cpp b/Userland/Applications/DisplaySettings/BackgroundSettingsWidget.cpp index 36e635abce..75671e5d1e 100644 --- a/Userland/Applications/DisplaySettings/BackgroundSettingsWidget.cpp +++ b/Userland/Applications/DisplaySettings/BackgroundSettingsWidget.cpp @@ -71,7 +71,12 @@ void BackgroundSettingsWidget::create_frame() m_context_menu->add_action(*m_show_in_file_manager_action); m_context_menu->add_separator(); - m_copy_action = GUI::CommonActions::make_copy_action([this](auto&) { GUI::Clipboard::the().set_plain_text(m_monitor_widget->wallpaper()); }, this); + m_copy_action = GUI::CommonActions::make_copy_action( + [this](auto&) { + auto url = URL::create_with_file_protocol(m_monitor_widget->wallpaper()).to_string(); + GUI::Clipboard::the().set_data(url.bytes(), "text/uri-list"); + }, + this); m_context_menu->add_action(*m_copy_action); m_wallpaper_view->on_context_menu_request = [&](const GUI::ModelIndex& index, const GUI::ContextMenuEvent& event) {