wl_client(3) | Wayland | wl_client(3) |
wl_client
void wl_client_flush (struct wl_client *client)
struct wl_display * wl_client_get_display (struct
wl_client *client)
void wl_client_get_credentials (struct wl_client *client, pid_t
*pid, uid_t *uid, gid_t *gid)
int wl_client_get_fd (struct wl_client *client)
struct wl_resource * wl_client_get_object (struct
wl_client *client, uint32_t id)
void wl_client_post_implementation_error (struct wl_client
*client, char const *msg,...)
struct wl_list * wl_client_get_link (struct wl_client
*client)
struct wl_client * wl_client_from_link (struct wl_list
*link)
void wl_client_add_resource_created_listener (struct wl_client
*client, struct wl_listener *listener)
void wl_client_for_each_resource (struct wl_client *client,
wl_client_for_each_resource_iterator_func_t iterator, void
*user_data)
struct wl_connection * connection
struct wl_event_source * source
struct wl_display * display
struct wl_resource * display_resource
struct wl_list link
struct wl_map objects
struct wl_priv_signal destroy_signal
struct ucred ucred
int error
struct wl_priv_signal resource_created_signal
Add a listener for the client's resource creation signal
Parameters
When a new resource is created for this client the listener will be notified, carrying the new resource as the data argument.
Flush pending events to the client
Parameters
Events sent to clients are queued in a buffer and written to the socket later - typically when the compositor has handled all requests and goes back to block in the event loop. This function flushes all queued up events for a client immediately.
Iterate over all the resources of a client
Parameters
The function pointed by iterator will be called for each resource owned by the client. The user_data will be passed as the second argument of the iterator function. If the iterator function returns WL_ITERATOR_CONTINUE the iteration will continue, if it returns WL_ITERATOR_STOP it will stop.
Creating and destroying resources while iterating is safe, but new resources may or may not be picked up by the iterator.
See also
Get a wl_client by its link
Parameters
See also
wl_display_get_client_list()
wl_client_get_link()
Return Unix credentials for the client
Parameters
This function returns the process ID, the user ID and the group ID for the given client. The credentials come from getsockopt() with SO_PEERCRED, on the client socket fd. All the pointers can be NULL, if the caller is not interested in a particular ID.
Be aware that for clients that a compositor forks and execs and then connects using socketpair(), this function will return the credentials for the compositor. The credentials for the socketpair are set at creation time in the compositor.
Get the display object for the given client
Parameters
Returns
Get the file descriptor for the client
Parameters
Returns
This function returns the file descriptor for the given client.
Be sure to use the file descriptor from the client for inspection only. If the caller does anything to the file descriptor that changes its state, it will likely cause problems.
See also wl_client_get_credentials(). It is recommended that you evaluate whether wl_client_get_credentials() can be applied to your use case instead of this function.
If you would like to distinguish just between the client and the compositor itself from the client's request, it can be done by getting the client credentials and by checking the PID of the client and the compositor's PID. Regarding the case in which the socketpair() is being used, you need to be careful. Please note the documentation for wl_client_get_credentials().
This function can be used for a compositor to validate a request from a client if there are additional information provided from the client's file descriptor. For instance, suppose you can get the security contexts from the client's file descriptor. The compositor can validate the client's request with the contexts and make a decision whether it permits or deny it.
Get the link by which a client is inserted in the client list
Parameters
See also
wl_display_get_client_list()
wl_client_from_link()
Look up an object in the client name space
Parameters
Returns
This looks up an object in the client object name space by its object ID.
Report an internal server error
Parameters
Report an unspecified internal implementation error and disconnect the client.
Generated automatically by Doxygen for Wayland from the source code.
Mon Aug 31 2020 | Version 1.18.0 |