server: Filter out wp_drm_lease_device from Xwayland

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
This commit is contained in:
Joshua Ashton 2022-12-29 01:54:02 +00:00 committed by Johan Malm
parent a81ae09245
commit 4fa2091677

View file

@ -11,6 +11,7 @@
#include <wlr/types/wlr_primary_selection_v1.h> #include <wlr/types/wlr_primary_selection_v1.h>
#include <wlr/types/wlr_screencopy_v1.h> #include <wlr/types/wlr_screencopy_v1.h>
#include <wlr/types/wlr_viewporter.h> #include <wlr/types/wlr_viewporter.h>
#include "drm-lease-v1-protocol.h"
#include "config/rcxml.h" #include "config/rcxml.h"
#include "config/session.h" #include "config/session.h"
#include "labwc.h" #include "labwc.h"
@ -160,6 +161,32 @@ handle_xwayland_ready(struct wl_listener *listener, void *data)
} }
#endif #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 void
server_init(struct server *server) server_init(struct server *server)
{ {
@ -169,6 +196,8 @@ server_init(struct server *server)
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
wl_display_set_global_filter(server->wl_display, server_global_filter, server);
/* Catch SIGHUP */ /* Catch SIGHUP */
struct wl_event_loop *event_loop = NULL; struct wl_event_loop *event_loop = NULL;
event_loop = wl_display_get_event_loop(server->wl_display); event_loop = wl_display_get_event_loop(server->wl_display);