xwayland: connect to the wl display before calling into EGL - xorg/xserver - X server (mirrored from https://gitlab.freedesktop.org/xorg/xserver)

index : xorg/xserver
X server (mirrored from https://gitlab.freedesktop.org/xorg/xserver) keithp
summary refs log tree commit diff
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2024年08月15日 13:23:10 -0400
committerOlivier Fourdan <ofourdan@redhat.com>2024年09月24日 11:33:13 +0200
commit0713e7e3824ff897c333c74ded5c51c8a66ea57d (patch)
treefd8d2253084281c51c908910fb25e4156155e02e
parent8d9b8249a7d2c489c84db9650a2140f2d97dd853 (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 (cherry picked from commit ff8ec59c97053b3fadaed635120665577fd7a43b) Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1702>
Diffstat
-rw-r--r--hw/xwayland/xwayland-screen.c 12
1 files changed, 6 insertions, 6 deletions
diff --git a/hw/xwayland/xwayland-screen.c b/hw/xwayland/xwayland-screen.c
index 4b575667a..822e55bf3 100644
--- a/hw/xwayland/xwayland-screen.c
+++ b/hw/xwayland/xwayland-screen.c
@@ -978,6 +978,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");
@@ -1006,12 +1012,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;
generated by cgit v1.2.3 (git 2.39.1) at 2025年04月25日 08:47:04 +0000

AltStyle によって変換されたページ (->オリジナル) /