]> git.mdlowis.com Git - proto/labwc.git/commitdiff
server: Filter out wp_drm_lease_device from Xwayland
authorJoshua Ashton <joshua@froggi.es>
Thu, 29 Dec 2022 01:54:02 +0000 (01:54 +0000)
committerJohan Malm <johanmalm@users.noreply.github.com>
Mon, 2 Jan 2023 21:26:42 +0000 (21:26 +0000)
For now, until we resolve the true cause here either on the Xwayland
side or our side.

I intend to look into it soon.

Fixes: #553
src/server.c

index 457960c05de7af0b1ed377ed314c690d115d3c2d..5a0b19e55de06ae70a7386128c9c1dead9769286 100644 (file)
@@ -11,6 +11,7 @@
 #include <wlr/types/wlr_primary_selection_v1.h>
 #include <wlr/types/wlr_screencopy_v1.h>
 #include <wlr/types/wlr_viewporter.h>
+#include "drm-lease-v1-protocol.h"
 #include "config/rcxml.h"
 #include "config/session.h"
 #include "labwc.h"
@@ -160,6 +161,32 @@ handle_xwayland_ready(struct wl_listener *listener, void *data)
 }
 #endif
 
+static bool
+server_global_filter(const struct wl_client *client, const struct wl_global *global, void *data)
+{
+       const struct wl_interface *iface = wl_global_get_interface(global);
+       struct server *server = (struct server *)data;
+       (void)iface; (void)server;
+
+#if HAVE_XWAYLAND
+       struct wl_client *xwayland_client =
+               server->xwayland ? server->xwayland->server->client : NULL;
+       if (xwayland_client && client == xwayland_client) {
+               /*
+                * Filter out wp_drm_lease_device_v1 for now as it is resulting in
+                * issues with Xwayland applications lagging over time.
+                *
+                * https://github.com/labwc/labwc/issues/553
+                */
+               if (!strcmp(iface->name, wp_drm_lease_device_v1_interface.name)) {
+                       return false;
+               }
+       }
+#endif
+
+       return true;
+}
+
 void
 server_init(struct server *server)
 {
@@ -169,6 +196,8 @@ server_init(struct server *server)
                exit(EXIT_FAILURE);
        }
 
+       wl_display_set_global_filter(server->wl_display, server_global_filter, server);
+
        /* Catch SIGHUP */
        struct wl_event_loop *event_loop = NULL;
        event_loop = wl_display_get_event_loop(server->wl_display);