diff options
Diffstat (limited to 'src/desktop/LayerSurface.cpp')
| -rw-r--r-- | src/desktop/LayerSurface.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/desktop/LayerSurface.cpp b/src/desktop/LayerSurface.cpp index f4ffaedf..428dcbbc 100644 --- a/src/desktop/LayerSurface.cpp +++ b/src/desktop/LayerSurface.cpp @@ -584,3 +584,15 @@ int CLayerSurface::popupsCount() { MONITORID CLayerSurface::monitorID() { return monitor ? monitor->ID : MONITOR_INVALID; } + +pid_t CLayerSurface::getPID() { + pid_t PID = -1; + + if (!layerSurface || !layerSurface->surface || !layerSurface->surface->getResource() || !layerSurface->surface->getResource()->resource() || + !layerSurface->surface->getResource()->resource()->client) + return -1; + + wl_client_get_credentials(layerSurface->surface->getResource()->resource()->client, &PID, nullptr, nullptr); + + return PID; +} |
