raveit65 f0248c3
From 9c4551c67d6fe854f7d37970398f5d5c9d17c28e Mon Sep 17 00:00:00 2001
raveit65 f0248c3
From: raveit65 <mate@raveit.de>
raveit65 f0248c3
Date: Thu, 29 Sep 2022 10:31:16 +0200
raveit65 f0248c3
Subject: [PATCH] Revert "xutils: Get the correct PID for clients inside PID
raveit65 f0248c3
 namespaces"
raveit65 f0248c3
raveit65 f0248c3
This reverts commit 07694559cc0c65ce1cca9ac33b165cef84c34d5e.
raveit65 f0248c3
raveit65 f0248c3
- fixing https://gitlab.gnome.org/GNOME/libwnck/-/issues/154#note_1562760
raveit65 f0248c3
---
raveit65 f0248c3
 libwnck/xutils.c | 36 +++---------------------------------
raveit65 f0248c3
 1 file changed, 3 insertions(+), 33 deletions(-)
raveit65 f0248c3
raveit65 f0248c3
diff --git a/libwnck/xutils.c b/libwnck/xutils.c
raveit65 f0248c3
index 60ae7b2..f2a2d3c 100644
raveit65 f0248c3
--- a/libwnck/xutils.c
raveit65 f0248c3
+++ b/libwnck/xutils.c
raveit65 f0248c3
@@ -27,9 +27,6 @@
raveit65 f0248c3
 #if HAVE_CAIRO_XLIB_XRENDER
raveit65 f0248c3
 #include <cairo-xlib-xrender.h>
raveit65 f0248c3
 #endif
raveit65 f0248c3
-#ifdef HAVE_XRES
raveit65 f0248c3
-#include <X11/extensions/XRes.h>
raveit65 f0248c3
-#endif
raveit65 f0248c3
 #include "screen.h"
raveit65 f0248c3
 #include "window.h"
raveit65 f0248c3
 #include "private.h"
raveit65 f0248c3
@@ -1149,41 +1146,14 @@ int
raveit65 f0248c3
 _wnck_get_pid (Screen *screen,
raveit65 f0248c3
                Window  xwindow)
raveit65 f0248c3
 {
raveit65 f0248c3
-  int pid = -1;
raveit65 f0248c3
-
raveit65 f0248c3
-#ifdef HAVE_XRES
raveit65 f0248c3
-  XResClientIdSpec client_spec;
raveit65 f0248c3
-  long client_id_count = 0;
raveit65 f0248c3
-  XResClientIdValue *client_ids = NULL;
raveit65 f0248c3
-
raveit65 f0248c3
-  client_spec.client = xwindow;
raveit65 f0248c3
-  client_spec.mask = XRES_CLIENT_ID_PID_MASK;
raveit65 f0248c3
-
raveit65 f0248c3
-  if (XResQueryClientIds (DisplayOfScreen (screen), 1, &client_spec,
raveit65 f0248c3
-                          &client_id_count, &client_ids) == Success)
raveit65 f0248c3
-    {
raveit65 f0248c3
-      long i;
raveit65 f0248c3
-
raveit65 f0248c3
-      for (i = 0; i < client_id_count; i++)
raveit65 f0248c3
-        {
raveit65 f0248c3
-          pid = XResGetClientPid (&client_ids[i]);
raveit65 f0248c3
-          if (pid != -1)
raveit65 f0248c3
-            break;
raveit65 f0248c3
-        }
raveit65 f0248c3
-
raveit65 f0248c3
-      XResClientIdsDestroy (client_id_count, client_ids);
raveit65 f0248c3
-
raveit65 f0248c3
-      if (pid != -1)
raveit65 f0248c3
-        return pid;
raveit65 f0248c3
-    }
raveit65 f0248c3
-#endif
raveit65 f0248c3
+  int val;
raveit65 f0248c3
 
raveit65 f0248c3
   if (!_wnck_get_cardinal (screen, xwindow,
raveit65 f0248c3
                            _wnck_atom_get ("_NET_WM_PID"),
raveit65 f0248c3
-                           &pid))
raveit65 f0248c3
+                           &val))
raveit65 f0248c3
     return 0;
raveit65 f0248c3
   else
raveit65 f0248c3
-    return pid;
raveit65 f0248c3
+    return val;
raveit65 f0248c3
 }
raveit65 f0248c3
 
raveit65 f0248c3
 char*
raveit65 f0248c3
-- 
raveit65 f0248c3
2.37.3
raveit65 f0248c3