summaryrefslogtreecommitdiff
path: root/src/file-manager/fm-desktop-icon-view.c
diff options
context:
space:
mode:
authorlukefromdc <[email protected]>2023-12-15 02:06:53 -0500
committerLuke from DC <[email protected]>2024-01-17 00:33:59 +0000
commit3d06d8b6dd1a26c26f34816a347524aeff3430b2 (patch)
tree109aa2a1f19c02490c3ef0115256cd8ec18cc149 /src/file-manager/fm-desktop-icon-view.c
parent8bb93666b35ee6277071d1b5ab4d52ae57d06975 (diff)
downloadcaja-3d06d8b6dd1a26c26f34816a347524aeff3430b2.tar.bz2
caja-3d06d8b6dd1a26c26f34816a347524aeff3430b2.tar.xz
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
Diffstat (limited to 'src/file-manager/fm-desktop-icon-view.c')
-rw-r--r--src/file-manager/fm-desktop-icon-view.c28
1 files changed, 22 insertions, 6 deletions
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 <gdk/gdkwayland.h>
+#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