From 45216c4f6040a84aeabd53bace79a58e354f9ab7 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Wed, 4 Dec 2013 11:45:46 +0000 Subject: [PATCH] window: enable client side decorations deactivation with wayland backend --- gtk/gtkwindow.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 29c3fccac7..e1aea9c858 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -5390,6 +5390,7 @@ static gboolean gdk_window_should_use_csd (GtkWindow *window) { GtkWindowPrivate *priv = window->priv; + const gchar *csd_env; if (!priv->decorated) return FALSE; @@ -5397,17 +5398,20 @@ gdk_window_should_use_csd (GtkWindow *window) if (priv->type == GTK_WINDOW_POPUP) return FALSE; -#ifdef GDK_WINDOWING_WAYLAND - if (GDK_IS_WAYLAND_DISPLAY (gtk_widget_get_display (GTK_WIDGET (window)))) - return TRUE; -#endif - #ifdef GDK_WINDOWING_BROADWAY if (GDK_IS_BROADWAY_DISPLAY (gtk_widget_get_display (GTK_WIDGET (window)))) return TRUE; #endif - return (g_strcmp0 (g_getenv ("GTK_CSD"), "1") == 0); + csd_env = g_getenv ("GTK_CSD"); + +#ifdef GDK_WINDOWING_WAYLAND + if (GDK_IS_WAYLAND_DISPLAY (gtk_widget_get_display (GTK_WIDGET (window))) && + g_strcmp0 (csd_env, "0") != 0) + return TRUE; +#endif + + return (g_strcmp0 (csd_env, "1") == 0); } static void