src/server.c: filter out xwayland shell for usual clients

This commit is contained in:
Consolatis 2024-02-26 00:54:57 +01:00 committed by Johan Malm
parent 74501bc7fa
commit 7e60c57b81
2 changed files with 10 additions and 3 deletions

View file

@ -18,6 +18,7 @@ server_protocols = [
wl_protocol_dir / 'unstable/pointer-constraints/pointer-constraints-unstable-v1.xml',
wl_protocol_dir / 'staging/cursor-shape/cursor-shape-v1.xml',
wl_protocol_dir / 'staging/drm-lease/drm-lease-v1.xml',
wl_protocol_dir / 'staging/xwayland-shell/xwayland-shell-v1.xml',
wl_protocol_dir / 'staging/tearing-control/tearing-control-v1.xml',
'wlr-layer-shell-unstable-v1.xml',
'wlr-input-inhibitor-unstable-v1.xml',

View file

@ -17,6 +17,7 @@
#include <wlr/types/wlr_viewporter.h>
#if HAVE_XWAYLAND
#include <wlr/xwayland.h>
#include "xwayland-shell-v1-protocol.h"
#endif
#include "drm-lease-v1-protocol.h"
#include "config/rcxml.h"
@ -172,9 +173,11 @@ server_global_filter(const struct wl_client *client, const struct wl_global *glo
(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) {
struct wl_client *xwayland_client = (server->xwayland && server->xwayland->server)
? server->xwayland->server->client
: NULL;
if (client == xwayland_client) {
/*
* Filter out wp_drm_lease_device_v1 for now as it is resulting in
* issues with Xwayland applications lagging over time.
@ -184,6 +187,9 @@ server_global_filter(const struct wl_client *client, const struct wl_global *glo
if (!strcmp(iface->name, wp_drm_lease_device_v1_interface.name)) {
return false;
}
} else if (!strcmp(iface->name, xwayland_shell_v1_interface.name)) {
/* Filter out the xwayland shell for usual clients */
return false;
}
#endif