summaryrefslogtreecommitdiff
path: root/src/caja-application.c
diff options
context:
space:
mode:
authorLuke from DC <[email protected]>2023-07-08 17:10:25 +0000
committerGitHub <[email protected]>2023-07-08 19:10:25 +0200
commitc1b2e7798670cc795979090023d1b9dcb2a0b330 (patch)
tree632a206d3501fd48f0e1d1af709b0c4054c49c84 /src/caja-application.c
parentdf25aef7d386d3bf8da08ec5d8dd9e44c9b09e50 (diff)
downloadcaja-c1b2e7798670cc795979090023d1b9dcb2a0b330.tar.bz2
caja-c1b2e7798670cc795979090023d1b9dcb2a0b330.tar.xz
wayland: initial support for showing the desktop
* Wayland: Support rendering the desktop *Wayland support is optional via the --enable-wayland option * eel-editable-label-c: remove unused variable This was leftover from earlier code compatable only with x11 * Fix gtk-layer-shell-0 version check, improve error message when Wayland requested but not found
Diffstat (limited to 'src/caja-application.c')
-rw-r--r--src/caja-application.c43
1 files changed, 23 insertions, 20 deletions
diff --git a/src/caja-application.c b/src/caja-application.c
index 1467e421..e6d3000a 100644
--- a/src/caja-application.c
+++ b/src/caja-application.c
@@ -634,19 +634,15 @@ selection_get_cb (GtkWidget *widget,
static GtkWidget *
get_desktop_manager_selection (GdkDisplay *display)
{
- /*FIXME: for Wayland we need a new desktop canvas anyway
- *so when that is ready we will need to add a wayland code
- *path here to support it
- */
- if (GDK_IS_X11_DISPLAY (display)){
- char selection_name[32];
- GdkAtom selection_atom;
- Window selection_owner;
- GtkWidget *selection_widget;
-
- g_snprintf (selection_name, sizeof (selection_name), "_NET_DESKTOP_MANAGER_S0");
- selection_atom = gdk_atom_intern (selection_name, FALSE);
+ char selection_name[32];
+ GdkAtom selection_atom;
+ Window selection_owner;
+ GtkWidget *selection_widget;
+ g_snprintf (selection_name, sizeof (selection_name), "_NET_DESKTOP_MANAGER_S0");
+ selection_atom = gdk_atom_intern (selection_name, FALSE);
+ if (GDK_IS_X11_DISPLAY (display))
+ {
selection_owner = XGetSelectionOwner (GDK_DISPLAY_XDISPLAY (display),
gdk_x11_atom_to_xatom_for_display (display,
selection_atom));
@@ -654,24 +650,31 @@ get_desktop_manager_selection (GdkDisplay *display)
{
return NULL;
}
+ }
+ selection_widget = gtk_invisible_new_for_screen (gdk_display_get_default_screen (display));
+ /* We need this for gdk_x11_get_server_time() */
+ gtk_widget_add_events (selection_widget, GDK_PROPERTY_CHANGE_MASK);
- selection_widget = gtk_invisible_new_for_screen (gdk_display_get_default_screen (display));
- /* We need this for gdk_x11_get_server_time() */
- gtk_widget_add_events (selection_widget, GDK_PROPERTY_CHANGE_MASK);
-
+ if (GDK_IS_X11_DISPLAY (display))
+ {
if (gtk_selection_owner_set_for_display (display,
selection_widget,
selection_atom,
gdk_x11_get_server_time (gtk_widget_get_window (selection_widget))))
{
-
g_signal_connect (selection_widget, "selection_get",
- G_CALLBACK (selection_get_cb), NULL);
+ G_CALLBACK (selection_get_cb), NULL);
return selection_widget;
}
-
- gtk_widget_destroy (selection_widget);
}
+ else
+ {
+ g_signal_connect (selection_widget, "selection_get",
+ G_CALLBACK (selection_get_cb), NULL);
+ return selection_widget;
+ }
+
+ gtk_widget_destroy (selection_widget);
return NULL;
}