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:
parent
6787fe8933
commit
01f4074421
3 changed files with 20 additions and 4 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue