mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-29 05:40:12 -04:00
Create & implement transient seat protocol
This commit is contained in:
parent
435ca39960
commit
3a91dc1b48
4 changed files with 225 additions and 0 deletions
63
include/wlr/types/wlr_transient_seat_v1.h
Normal file
63
include/wlr/types/wlr_transient_seat_v1.h
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
/*
|
||||
* This an unstable interface of wlroots. No guarantees are made regarding the
|
||||
* future consistency of this API.
|
||||
*/
|
||||
#ifndef WLR_USE_UNSTABLE
|
||||
#error "Add -DWLR_USE_UNSTABLE to enable unstable wlroots features"
|
||||
#endif
|
||||
|
||||
#ifndef WLR_TYPES_WLR_TRANSIENT_SEAT_V1_H
|
||||
#define WLR_TYPES_WLR_TRANSIENT_SEAT_V1_H
|
||||
|
||||
#include <wayland-server-core.h>
|
||||
|
||||
struct wlr_seat;
|
||||
|
||||
struct wlr_transient_seat_v1 {
|
||||
struct wl_resource *resource;
|
||||
struct wlr_seat *seat;
|
||||
|
||||
// private state
|
||||
struct wl_listener seat_destroy;
|
||||
};
|
||||
|
||||
struct wlr_transient_seat_manager_v1 {
|
||||
struct wl_global *global;
|
||||
struct wl_listener display_destroy;
|
||||
|
||||
struct {
|
||||
/**
|
||||
* Upon receiving this signal, call
|
||||
* wlr_transient_seat_v1_ready() to pass a newly created seat
|
||||
* to the manager, or
|
||||
* wlr_transient_seat_v1_deny() to deny the request to create
|
||||
* a seat.
|
||||
*/
|
||||
struct wl_signal create_seat; // struct wlr_transient_seat_v1
|
||||
} events;
|
||||
};
|
||||
|
||||
struct wlr_transient_seat_manager_v1 *wlr_transient_seat_manager_v1_create(
|
||||
struct wl_display *display);
|
||||
|
||||
/**
|
||||
* To be called when the create_seat event is received.
|
||||
*
|
||||
* This signals that the seat was successfully added and is ready.
|
||||
*
|
||||
* When the transient seat is destroyed by the client, the wlr_seat will be
|
||||
* destroyed. The wlr_seat may also be destroyed from elsewhere, in which case
|
||||
* the transient seat will become inert.
|
||||
*/
|
||||
void wlr_transient_seat_v1_ready(struct wlr_transient_seat_v1 *seat,
|
||||
struct wlr_seat *wlr_seat);
|
||||
|
||||
/**
|
||||
* To be called when the create_seat event is received.
|
||||
*
|
||||
* This signals that the compositor has denied the user's request to create a
|
||||
* transient seat.
|
||||
*/
|
||||
void wlr_transient_seat_v1_deny(struct wlr_transient_seat_v1 *seat);
|
||||
|
||||
#endif /* WLR_TYPES_WLR_TRANSIENT_SEAT_V1_H */
|
||||
Loading…
Add table
Add a link
Reference in a new issue