Initialization and manipulation of seats

A seat has two identifiers, the physical name and the logical name. More...

Data Structures

struct  libinput_seat
 The base handle for accessing libinput seats. More...
 

Functions

struct libinput_seatlibinput_seat_ref (struct libinput_seat *seat)
 Increase the refcount of the seat. More...
 
struct libinput_seatlibinput_seat_unref (struct libinput_seat *seat)
 Decrease the refcount of the seat. More...
 
void libinput_seat_set_user_data (struct libinput_seat *seat, void *user_data)
 Set caller-specific data associated with this seat. More...
 
void * libinput_seat_get_user_data (struct libinput_seat *seat)
 Get the caller-specific data associated with this seat, if any. More...
 
struct libinputlibinput_seat_get_context (struct libinput_seat *seat)
 Get the libinput context from the seat. More...
 
const char * libinput_seat_get_physical_name (struct libinput_seat *seat)
 Return the physical name of the seat. More...
 
const char * libinput_seat_get_logical_name (struct libinput_seat *seat)
 Return the logical name of the seat. More...
 

Detailed Description

A seat has two identifiers, the physical name and the logical name.

A device is always assigned to exactly one seat. It may change to a different logical seat but it cannot change physical seats. See Seats for details.

Function Documentation

◆ libinput_seat_get_context()

struct libinput* libinput_seat_get_context ( struct libinput_seat seat)

Get the libinput context from the seat.

Parameters
seatA previously obtained seat
Returns
The libinput context for this seat.

◆ libinput_seat_get_logical_name()

const char* libinput_seat_get_logical_name ( struct libinput_seat seat)

Return the logical name of the seat.

This is an identifier to group sets of devices within the compositor.

Parameters
seatA previously obtained seat
Returns
The logical name of this seat

◆ libinput_seat_get_physical_name()

const char* libinput_seat_get_physical_name ( struct libinput_seat seat)

Return the physical name of the seat.

For libinput contexts created from udev, this is always the same value as passed into libinput_udev_assign_seat() and all seats from that context will have the same physical name.

The physical name of the seat is one that is usually set by the system or lower levels of the stack. In most cases, this is the base filter for devices - devices assigned to seats outside the current seat will not be available to the caller.

Parameters
seatA previously obtained seat
Returns
The physical name of this seat

◆ libinput_seat_get_user_data()

void* libinput_seat_get_user_data ( struct libinput_seat seat)

Get the caller-specific data associated with this seat, if any.

Parameters
seatA previously obtained seat
Returns
Caller-specific data pointer or NULL if none was set
See also
libinput_seat_set_user_data

◆ libinput_seat_ref()

struct libinput_seat* libinput_seat_ref ( struct libinput_seat seat)

Increase the refcount of the seat.

A seat will be freed whenever the refcount reaches 0. This may happen during libinput_dispatch() if the seat was removed from the system. A caller must ensure to reference the seat correctly to avoid dangling pointers.

Parameters
seatA previously obtained seat
Returns
The passed seat

◆ libinput_seat_set_user_data()

void libinput_seat_set_user_data ( struct libinput_seat seat,
void *  user_data 
)

Set caller-specific data associated with this seat.

libinput does not manage, look at, or modify this data. The caller must ensure the data is valid.

Parameters
seatA previously obtained seat
user_dataCaller-specific data pointer
See also
libinput_seat_get_user_data

◆ libinput_seat_unref()

struct libinput_seat* libinput_seat_unref ( struct libinput_seat seat)

Decrease the refcount of the seat.

A seat will be freed whenever the refcount reaches 0. This may happen during libinput_dispatch() if the seat was removed from the system. A caller must ensure to reference the seat correctly to avoid dangling pointers.

Parameters
seatA previously obtained seat
Returns
NULL if seat was destroyed, otherwise the passed seat