xx_linux_foreign_toplevel_pidfd_v1
- external
The purpose of this protocol is to provide a way for Linux based compositors to identify the process a toplevel belongs to.
This protocol depends on the ext-foreign-toplevel-list protocol.
The compositor may choose to restrict this protocol to a special client launched by the compositor itself or expose it to all clients, this is compositor policy.
The key words "must", "must not", "required", "shall", "shall not", "should", "should not", "recommended", "may", and "optional" in this document are to be interpreted as described in IETF RFC 2119.
Warning! The protocol described in this file is currently in the experimental phase. Backwards incompatible major versions of the protocol are to be expected. Exposing this protocol without an opt-in mechanism is discouraged.
This interface allows a compositor to announce support for supplying pidfds for the processes of toplevels to the client.
destroy()
Using this request a client can tell the server that it is not going to use the xx_linux_foreign_toplevel_pidfd_manager_v1 object anymore.
Any objects already created through this instance are not affected.
get_pidfd(handle: object<ext_foreign_toplevel_list_v1>, id: new_id<xx_linux_foreign_toplevel_pidfd_v1>)
Argument | Type | Description |
|---|---|---|
| handle | object<ext_foreign_toplevel_list_v1> | |
| id | new_id<xx_linux_foreign_toplevel_pidfd_v1> |
This creates a new linux_foreign_toplevel_pidfd object for the ext_foreign_toplevel_list_v1. The created object can then be used to receive pidfds of procceses that belong to toplevels.
xx_linux_foreign_toplevel_pidfd_v1
After a client binds the xx_linux_foreign_toplevel_pidfd_v1 the compositor will send pidfds for all existing toplevels and each new toplevel window announced via the ext_foreign_toplevel_list_v1.toplevel event will also send a pidfd.
If a compositor implementation sends the xx_foreign_toplevel_pidfd_v1.finished event, the compositor must not send any more xx_linux_foreign_toplevel_pidfd_v1.pidfd events.
A pidfd references the toplevel's process identifier (pid) via a file descriptor see pidfd_open(1).
destroy()
Using this request a client can tell the server that it is not going to use the xx_linux_foreign_toplevel_pidfd_v1 object anymore.
pidfd(toplevel: object<ext_foreign_toplevel_handle_v1>, pidfd: fd)
Argument | Type | Description |
|---|---|---|
| toplevel | object<ext_foreign_toplevel_handle_v1> | |
| pidfd | fd | pid fd |
This event is emitted whenever a new toplevel window is created. It is emitted for all toplevels, regardless of the app that has created them.
The pidfd refers to the toplevel's process identifier.
finished()
This event indicates that the compositor is done sending events to this object. The client should destroy the object. See xx_foreign_toplevel_pidfd_v1.destroy for more information.
Compositor Support
Copyright
Copyright © 2026 Phosh.mobi e.V.
Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the copyright holders not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. The copyright holders make no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.
THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.