summaryrefslogtreecommitdiff
path: root/client.h
diff options
context:
space:
mode:
author0scar <qgt268@alumni.ku.dk>2024-09-30 10:37:36 +0000
committer0scar <qgt268@alumni.ku.dk>2024-10-01 11:53:32 +0000
commit40c2808d355606d7bff39daf23dbe23f2b73d585 (patch)
tree0bbc5e255e5afa2465e377dc5446d3c0750983d7 /client.h
parent63278a4ceef14693fb3bf6c62174359faebf2036 (diff)
Patch: swallow
Diffstat (limited to 'client.h')
-rw-r--r--client.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/client.h b/client.h
index 389b4f0..f8e7dda 100644
--- a/client.h
+++ b/client.h
@@ -131,6 +131,18 @@ client_get_appid(Client *c)
return c->surface.xdg->toplevel->app_id ? c->surface.xdg->toplevel->app_id : "broken";
}
+static inline int
+client_get_pid(Client *c)
+{
+ pid_t pid;
+#ifdef XWAYLAND
+ if (client_is_x11(c))
+ return c->surface.xwayland->pid;
+#endif
+ wl_client_get_credentials(c->surface.xdg->client->client, &pid, NULL, NULL);
+ return pid;
+}
+
static inline void
client_get_clip(Client *c, struct wlr_box *clip)
{