1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Alberts=20Muktup=C4=81vels?= <alberts.muktupavels@gmail.com>
3 Date: Fri, 30 Sep 2022 18:07:55 +0300
4 Subject: [PATCH] xutils: move XRes code to separate function
7 libwnck/xutils.c | 28 ++++++++++++++++++++--------
8 1 file changed, 20 insertions(+), 8 deletions(-)
10 diff --git a/libwnck/xutils.c b/libwnck/xutils.c
11 index 60ae7b253228..d120ff16c0da 100644
12 --- a/libwnck/xutils.c
13 +++ b/libwnck/xutils.c
14 @@ -1145,37 +1145,49 @@ _wnck_get_session_id (Screen *screen,
15 _wnck_atom_get ("SM_CLIENT_ID"));
19 -_wnck_get_pid (Screen *screen,
23 +xres_get_pid (Screen *screen,
29 XResClientIdSpec client_spec;
30 long client_id_count = 0;
31 XResClientIdValue *client_ids = NULL;
33 client_spec.client = xwindow;
34 client_spec.mask = XRES_CLIENT_ID_PID_MASK;
36 if (XResQueryClientIds (DisplayOfScreen (screen), 1, &client_spec,
37 &client_id_count, &client_ids) == Success)
41 for (i = 0; i < client_id_count; i++)
43 pid = XResGetClientPid (&client_ids[i]);
48 XResClientIdsDestroy (client_id_count, client_ids);
59 +_wnck_get_pid (Screen *screen,
65 + pid = xres_get_pid (screen, xwindow);
71 if (!_wnck_get_cardinal (screen, xwindow,