summaryrefslogtreecommitdiff
path: root/gdk/wayland/gdkwindow-wayland.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-04-28 20:35:51 -0400
committerMatthias Clasen <mclasen@redhat.com>2017-10-26 15:51:56 -0400
commit1b279e3d4ac33ebd9a3925d1a388c28bd96232d5 (patch)
tree53a2aa12712990e23be747be2c5a620d348851af /gdk/wayland/gdkwindow-wayland.c
parent028e39d6ee53a5c09da4b4d5a9bbb1d6e768f368 (diff)
downloadgtk+-1b279e3d4ac33ebd9a3925d1a388c28bd96232d5.tar.gz
Wayland: Implement KDE's SSD protocol
If the compositor prefers server-side decorations and the client doesn't customize the title bar, we disable client-side decorations and let the compositor know. Otherwise, we continue to use client-side decorations. Signed-off-by: Drew DeVault <sir@cmpwn.com> https://bugzilla.gnome.org/show_bug.cgi?id=781909
Diffstat (limited to 'gdk/wayland/gdkwindow-wayland.c')
-rw-r--r--gdk/wayland/gdkwindow-wayland.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index 157d41da61..298435ec7a 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -117,6 +117,7 @@ struct _GdkWindowImplWayland
struct wl_egl_window *egl_window;
struct wl_egl_window *dummy_egl_window;
struct zxdg_exported_v1 *xdg_exported;
+ struct org_kde_kwin_server_decoration *server_decoration;
} display_server;
EGLSurface egl_surface;
@@ -1663,6 +1664,21 @@ window_anchor_to_gravity (GdkGravity rect_anchor)
ZXDG_POSITIONER_V6_GRAVITY_RIGHT);
}
+void
+gdk_wayland_window_announce_csd (GdkWindow *window)
+{
+ GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
+ GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ if (!display_wayland->server_decoration_manager)
+ return;
+ impl->display_server.server_decoration =
+ org_kde_kwin_server_decoration_manager_create (display_wayland->server_decoration_manager,
+ impl->display_server.wl_surface);
+ if (impl->display_server.server_decoration)
+ org_kde_kwin_server_decoration_request_mode (impl->display_server.server_decoration,
+ ORG_KDE_KWIN_SERVER_DECORATION_MANAGER_MODE_CLIENT);
+}
+
static GdkWindow *
get_real_parent_and_translate (GdkWindow *window,
gint *x,