]> git.mdlowis.com Git - proto/labwc.git/commitdiff
xwayland: allow persistence
authorAndrew J. Hesford <ajh@sideband.org>
Wed, 3 Jul 2024 17:43:04 +0000 (13:43 -0400)
committerConsolatis <35009135+Consolatis@users.noreply.github.com>
Thu, 4 Jul 2024 03:19:19 +0000 (05:19 +0200)
Closes: #1958.
docs/labwc-config.5.scd
docs/rc.xml.all
include/config/rcxml.h
src/config/rcxml.c
src/xwayland.c

index 85a8d4376f16656b21133018598c8ebead0faf93..f212ca0f41cc5b7900cd995f5533879cd8061856 100644 (file)
@@ -194,6 +194,13 @@ this is for compatibility with Openbox.
        be used with labwc the preferred mode of the monitor is used instead.
        Default is no.
 
+*<core><xwaylandPersistence>* [yes|no]
+       Keep XWayland alive even when no clients are connected, rather than
+       using a "lazy" policy that allows the server to launch on demand and die
+       when it is no longer needed. Default is no.
+
+       Note: changing this setting requires a restart of labwc.
+
 ## PLACEMENT
 
 *<placement><policy>* [center|automatic|cursor]
index 35e5c91b75f43d04c670466867eb79bc91a2b0a8..1f4a0f6931f53ba514816a7dd8279537c49ed376 100644 (file)
@@ -13,6 +13,7 @@
     <adaptiveSync>no</adaptiveSync>
     <allowTearing>no</allowTearing>
     <reuseOutputMode>no</reuseOutputMode>
+    <xwaylandPersistence>no</xwaylandPersistence>
   </core>
 
   <placement>
index 8df7c9aab6b599ac62c02adbba5db0f7882c1e4c..a9e895894ba41c3b302cfd0b01f11813c99114ab 100644 (file)
@@ -55,6 +55,7 @@ struct rcxml {
        bool allow_tearing;
        bool reuse_output_mode;
        enum view_placement_policy placement_policy;
+       bool xwayland_persistence;
 
        /* focus */
        bool focus_follow_mouse;
index 0ff52bf301fd2fb75c80f9b1b38b1fdf1cb18bd6..d263cb9d70fb141859c49202b09ed5494a13c0d3 100644 (file)
@@ -899,6 +899,8 @@ entry(xmlNode *node, char *nodename, char *content)
                if (rc.placement_policy == LAB_PLACE_INVALID) {
                        rc.placement_policy = LAB_PLACE_CENTER;
                }
+       } else if (!strcasecmp(nodename, "xwaylandPersistence.core")) {
+               set_bool(content, &rc.xwayland_persistence);
        } else if (!strcmp(nodename, "name.theme")) {
                rc.theme_name = xstrdup(content);
        } else if (!strcmp(nodename, "cornerradius.theme")) {
index d4eff83d659b605acf1579cfcd8b78c81d5d4bf8..72eaa7cf813ebc28c21e5796f7e168a5b6a935fe 100644 (file)
@@ -6,6 +6,7 @@
 #include "common/array.h"
 #include "common/macros.h"
 #include "common/mem.h"
+#include "config/rcxml.h"
 #include "labwc.h"
 #include "node.h"
 #include "ssd.h"
@@ -1052,7 +1053,8 @@ void
 xwayland_server_init(struct server *server, struct wlr_compositor *compositor)
 {
        server->xwayland =
-               wlr_xwayland_create(server->wl_display, compositor, true);
+               wlr_xwayland_create(server->wl_display,
+                       compositor, /* lazy */ !rc.xwayland_persistence);
        if (!server->xwayland) {
                wlr_log(WLR_ERROR, "cannot create xwayland server");
                exit(EXIT_FAILURE);