From e2e94ed5c3e6546e4a7653280e02f4fcd4a0f20b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberts=20Muktup=C4=81vels?= Date: Sun, 8 Jan 2023 15:45:04 +0200 Subject: handle: avoid segfault in init_xres Under Wayland display will be NULL, add early return to avoid segfault. https://gitlab.gnome.org/GNOME/libwnck/-/issues/157 --- libwnck/wnck-handle.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libwnck/wnck-handle.c b/libwnck/wnck-handle.c index e6d776b..0ea789e 100644 --- a/libwnck/wnck-handle.c +++ b/libwnck/wnck-handle.c @@ -185,6 +185,10 @@ init_xres (WnckHandle *self) int minor; xdisplay = _wnck_get_default_display (); + + if (xdisplay == NULL) + return; + event_base = error_base = major = minor = 0; if (XResQueryExtension (xdisplay, &event_base, &error_base) && -- cgit v1.2.1