summaryrefslogtreecommitdiff
path: root/src/Window.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-06-27 13:42:20 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-06-27 13:42:20 +0200
commit781526dac58619fa313ca9bf86bfd712c01cb68f (patch)
tree93139652439c65fc49b66437292dacb4c2efb258 /src/Window.cpp
parentb9a5fc0d2f76718833b49ec01234496f5002a677 (diff)
added hyprctl kill
Diffstat (limited to 'src/Window.cpp')
-rw-r--r--src/Window.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/Window.cpp b/src/Window.cpp
index 3d669e70..fc09b330 100644
--- a/src/Window.cpp
+++ b/src/Window.cpp
@@ -77,4 +77,16 @@ wlr_box CWindow::getWindowIdealBoundingBoxIgnoreReserved() {
void CWindow::updateWindowDecos() {
for (auto& wd : m_dWindowDecorations)
wd->updateWindow(this);
-} \ No newline at end of file
+}
+
+pid_t CWindow::getPID() {
+ pid_t PID = -1;
+ if (!m_bIsX11) {
+ const auto CLIENT = wl_resource_get_client(m_uSurface.xdg->resource);
+ wl_client_get_credentials(CLIENT, &PID, nullptr, nullptr);
+ } else {
+ PID = m_uSurface.xwayland->pid;
+ }
+
+ return PID;
+}