hyprctl/layers: print pid for layershell clients (#9468)

Adds a `getPID()` fn to layershell to print it in `hyprctl layers`
This commit is contained in:
littleblack111 2025-02-26 23:03:06 +08:00 committed by GitHub
parent 6787fe8933
commit 01f4074421
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 20 additions and 4 deletions

View file

@ -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;
}