summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Ashton <joshua@froggi.es>2022-12-29 08:05:19 +0000
committerOlivier Fourdan <fourdan@gmail.com>2023-01-12 14:34:20 +0000
commit0abb5770750e54566d3ce14a3be9dbf15bb578ba (patch)
tree2654a9796137e84dac37af90bac3b20ab898f6ee
parent39934a656a44722d16a80bf4db411c53e2d67b38 (diff)
downloadxserver-0abb5770750e54566d3ce14a3be9dbf15bb578ba.tar.gz
xwayland: Don't expose XRandR emulated modes for leaseable displays
Leasable displays do not have any actual associated Wayland output and are not available to regular X11 clients and left entirely to the application who requests the lease. As these are not actually managed by the Wayland compositor and left entirely to the "lessee" application, the viewporter protocol required for the XRandR emulation is not usable on such devices. We should therefore not advertise the XRandR emulated modes for those leasable displays. This also solves a problem with implementations of glXGetMscRateOML() which is used notably by Chromium/Electron. Applications using this which will begin lagging/stuttering exponentially over time, trying to look up a non-existent mode with 0x0 as returned by XF86VidModeGetModeLine() with XRandR emulation for such devices. See-also: https://github.com/labwc/labwc/issues/553 Signed-off-by: Joshua Ashton <joshua@froggi.es>
-rw-r--r--hw/xwayland/xwayland-output.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c
index 9109145ab..7a9352f58 100644
--- a/hw/xwayland/xwayland-output.c
+++ b/hw/xwayland/xwayland-output.c
@@ -224,8 +224,8 @@ xwl_output_get_emulated_mode_for_client(struct xwl_output *xwl_output,
if (!xwl_output)
return NULL;
- /* We don't do XRandr emulation when rootful */
- if (!xwl_output->xwl_screen->rootless)
+ /* We don't do XRandr emulation when rootful or a fake lease display */
+ if (!xwl_output->xwl_screen->rootless || !xwl_output->output)
return NULL;
for (i = 0; i < XWL_CLIENT_MAX_EMULATED_MODES; i++) {