Skip to content

Commit

Permalink
wallpaper: Fix misuse of picture-uri gsetting
Browse files Browse the repository at this point in the history
The Portal was setting the org.gnome.desktop.background picture-uri
gsetting to a path, when applications expect an URI.

Fixes #374
  • Loading branch information
felipeborges authored and GeorgesStavracas committed Oct 18, 2023
1 parent 0dc1607 commit 6147499
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/wallpaper.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ on_file_copy_cb (GObject *source_object,
goto out;
}

destination = g_file_new_for_path (handle->picture_uri);
destination = g_file_new_for_uri (handle->picture_uri);
if (!g_file_replace_contents (destination,
contents,
length,
Expand All @@ -130,8 +130,16 @@ set_wallpaper (WallpaperDialogHandle *handle,
const gchar *uri)
{
g_autoptr(GFile) source = NULL;
g_autoptr(GError) error = NULL;
g_autrofree gchar *path = NULL;

handle->picture_uri = g_build_filename (g_get_user_config_dir (), "background", NULL);
path = g_build_filename (g_get_user_config_dir (), "background", NULL);
handle->picture_uri = g_filename_to_uri (path, NULL, &error);
if (error)
{
g_warning ("Failed to construct wallpaper uri: %s", error->message);
return;
}

source = g_file_new_for_uri (uri);
g_file_load_contents_async (source,
Expand Down

0 comments on commit 6147499

Please sign in to comment.