From 3d06d8b6dd1a26c26f34816a347524aeff3430b2 Mon Sep 17 00:00:00 2001 From: lukefromdc Date: Fri, 15 Dec 2023 02:06:53 -0500 Subject: Manage desktop backgrounds when running in wayland *Draw the background on the desktop window, using the same code as on navigation windows to bypass the no-root-window issue. *Works from caja's "Change Desktop Background" menu item, from caja-extensions "set as wallpaper" and with changing the background in dconf-editor. *All background options available in x11 supported in wayland, UI is new for wayland *Apply changes immediately, keep the dialog open until closed by user *Let users see changes in realtime while keeping the dialog open *Preview both colors and pictures *Add ability to apply changes from either combobox including using any image saved from when dialog was opened *Add tooltips to the buttons, filepicker, and comboboxes --- src/file-manager/fm-desktop-icon-view.c | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'src/file-manager/fm-desktop-icon-view.c') diff --git a/src/file-manager/fm-desktop-icon-view.c b/src/file-manager/fm-desktop-icon-view.c index 3a88b091..0d0c034a 100644 --- a/src/file-manager/fm-desktop-icon-view.c +++ b/src/file-manager/fm-desktop-icon-view.c @@ -62,6 +62,12 @@ #include "fm-desktop-icon-view.h" #include "fm-actions.h" +#ifdef HAVE_WAYLAND +#include +#include "fm-desktop-wayland-bg-dialog.h" + +#endif + /* Timeout to check the desktop directory for updates */ #define RESCAN_TIMEOUT 4 @@ -707,12 +713,22 @@ action_change_background_callback (GtkAction *action, gpointer data) { g_assert (FM_DIRECTORY_VIEW (data)); - - caja_launch_application_from_command (gtk_widget_get_screen (GTK_WIDGET (data)), - _("Background"), - "mate-appearance-properties", - FALSE, - "--show-page=background", NULL); +#ifdef HAVE_WAYLAND + /*Get the new background and switch to it in wayland*/ + if (GDK_IS_WAYLAND_DISPLAY (gdk_display_get_default())) + { + wayland_bg_dialog_new (); + } + else +#endif + /*Get the new background and switch to it in x11*/ + { + caja_launch_application_from_command (gtk_widget_get_screen (GTK_WIDGET (data)), + _("Background"), + "mate-appearance-properties", + FALSE, + "--show-page=background", NULL); + } } static void -- cgit v1.2.1