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 --- eel/eel-background.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'eel') diff --git a/eel/eel-background.c b/eel/eel-background.c index 2b50d450..f79797c8 100644 --- a/eel/eel-background.c +++ b/eel/eel-background.c @@ -424,16 +424,17 @@ set_root_surface (EelBackground *self, GdkScreen *screen) { eel_background_ensure_realized (self); + GdkDisplay *display = gdk_screen_get_display (screen); if (self->details->use_common_surface) { self->details->unset_root_surface = FALSE; } else { int width, height; drawable_get_adjusted_size (self, &width, &height); - self->details->bg_surface = mate_bg_create_surface (self->details->bg, window, - width, height, TRUE); + if ((GDK_IS_X11_DISPLAY (display)) || (self->details->bg_surface == NULL)) + self->details->bg_surface = mate_bg_create_surface (self->details->bg, window, + width, height, TRUE); } - GdkDisplay *display = gdk_screen_get_display (screen); if ((GDK_IS_X11_DISPLAY (display)) && (self->details->bg_surface != NULL)) mate_bg_set_surface_as_root (screen, self->details->bg_surface); } @@ -671,11 +672,10 @@ widget_realized_setup (GtkWidget *widget, self->details->use_common_surface = (gdk_window_get_visual (window) == gtk_widget_get_visual (widget)) ? TRUE : FALSE; } - else /*Wayland is always composited*/ + else /*Wayland is always composited but never has a root window*/ { - self->details->use_common_surface = TRUE; + self->details->use_common_surface = FALSE; } - init_fade (self); } -- cgit v1.2.1