]> git.mdlowis.com Git - proto/labwc.git/commitdiff
Decorations: always default to client side decorations
authorConsolatis <35009135+Consolatis@users.noreply.github.com>
Fri, 24 Mar 2023 19:21:21 +0000 (20:21 +0100)
committerJohan Malm <johanmalm@users.noreply.github.com>
Sat, 25 Mar 2023 07:24:40 +0000 (07:24 +0000)
This is required as both decoration protocol variants, the xdg one
and the deprecated kde one, assume that an application that did not
negotiate any decorations will render client side decorations.

src/xdg.c

index 921a5864f9e9dcce07c537edb54002a8f5d7a15e..806be850dff3d3405e2a6e1e55ce15193967662a 100644 (file)
--- a/src/xdg.c
+++ b/src/xdg.c
@@ -545,7 +545,21 @@ xdg_surface_new(struct wl_listener *listener, void *data)
        node_descriptor_create(&view->scene_tree->node,
                LAB_NODE_DESC_VIEW, view);
 
-       /* In support of xdg_toplevel_decoration and kde_server_decoration */
+       /*
+        * The xdg_toplevel_decoration and kde_server_decoration protocols
+        * expects clients to use client side decorations unless server side
+        * decorations are negotiated. So we default to client side ones here.
+        *
+        * TODO: We may want to assign the default based on a new rc.xml
+        *       config option like "enforce-server" in the future.
+        */
+       view->ssd_preference = LAB_SSD_PREF_CLIENT;
+
+       /*
+        * xdg_toplevel_decoration and kde_server_decoration use this
+        * pointer to connect the view to a decoration object that may
+        * be created in the future.
+        */
        xdg_surface->data = view;
 
        /*