summaryrefslogtreecommitdiff
path: root/hw/xwayland
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2024-08-15 13:23:10 -0400
committerMarge Bot <emma+marge@anholt.net>2024-09-24 08:07:39 +0000
commitff8ec59c97053b3fadaed635120665577fd7a43b (patch)
tree648f32664c214fb9e2ea5c28c0a15e0e5269b7b0 /hw/xwayland
parent57a446c0f98693bd2e0263e91213344d870f4e03 (diff)
xwayland: connect to the wl display before calling into EGL
using EGL (e.g., eglQueryString, epoxy_has_egl_extension) before establishing this connection enables the GBM/EGL implementation to potentially consume the WAYLAND_SOCKET fd, which, if closed, will cause the compositor to kill this xserver Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1646>
Diffstat (limited to 'hw/xwayland')
-rw-r--r--hw/xwayland/xwayland-screen.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/hw/xwayland/xwayland-screen.c b/hw/xwayland/xwayland-screen.c
index f79d9ebc0..764176df5 100644
--- a/hw/xwayland/xwayland-screen.c
+++ b/hw/xwayland/xwayland-screen.c
@@ -984,6 +984,12 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
return FALSE;
}
+ xwl_screen->display = wl_display_connect(NULL);
+ if (xwl_screen->display == NULL) {
+ ErrorF("could not connect to wayland server\n");
+ return FALSE;
+ }
+
#ifdef XWL_HAS_GLAMOR
if (xwl_screen->glamor && !xwl_glamor_init_gbm(xwl_screen)) {
ErrorF("xwayland glamor: failed to setup GBM backend, falling back to sw accel\n");
@@ -1012,12 +1018,6 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
if (!monitorResolution)
monitorResolution = DEFAULT_DPI;
- xwl_screen->display = wl_display_connect(NULL);
- if (xwl_screen->display == NULL) {
- ErrorF("could not connect to wayland server\n");
- return FALSE;
- }
-
if (use_fixed_size) {
if (!xwl_screen_init_randr_fixed(xwl_screen))
return FALSE;