From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alberts=20Muktup=C4=81vels?= <alberts.muktupavels@gmail.com>
Date: Fri, 30 Sep 2022 18:43:07 +0300
Subject: [PATCH] xutils: check if XRes is available before using
 XResQueryClientIds

https://gitlab.gnome.org/GNOME/libwnck/-/issues/154
---
 libwnck/xutils.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libwnck/xutils.c b/libwnck/xutils.c
index 08be8aa96f1a..91c2d50ee733 100644
--- a/libwnck/xutils.c
+++ b/libwnck/xutils.c
@@ -1156,6 +1156,9 @@ xres_get_pid (WnckScreen *screen,
   long client_id_count = 0;
   XResClientIdValue *client_ids = NULL;
 
+  if (!_wnck_handle_has_xres (wnck_screen_get_handle (screen)))
+    return -1;
+
   xscreen = _wnck_screen_get_xscreen (screen);
 
   client_spec.client = xwindow;
