wayland/seat: Add API to check whether a seat has a device class
Meant to replace explicitly checking whether a MetaWaylandPointer/MetaWaylandKeyboard/MetaWaylandTouch has a seat or not to determine whether they are supposed to be active or not. https://bugzilla.gnome.org/show_bug.cgi?id=771305
This commit is contained in:
parent
5d3cacf8d2
commit
d2cdbd433d
@ -445,3 +445,21 @@ meta_wayland_seat_can_popup (MetaWaylandSeat *seat,
|
|||||||
meta_wayland_keyboard_can_popup (seat->keyboard, serial) ||
|
meta_wayland_keyboard_can_popup (seat->keyboard, serial) ||
|
||||||
meta_wayland_touch_can_popup (seat->touch, serial));
|
meta_wayland_touch_can_popup (seat->touch, serial));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
meta_wayland_seat_has_keyboard (MetaWaylandSeat *seat)
|
||||||
|
{
|
||||||
|
return (seat->capabilities & WL_SEAT_CAPABILITY_KEYBOARD) != 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
meta_wayland_seat_has_pointer (MetaWaylandSeat *seat)
|
||||||
|
{
|
||||||
|
return (seat->capabilities & WL_SEAT_CAPABILITY_POINTER) != 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
meta_wayland_seat_has_touch (MetaWaylandSeat *seat)
|
||||||
|
{
|
||||||
|
return (seat->capabilities & WL_SEAT_CAPABILITY_TOUCH) != 0;
|
||||||
|
}
|
||||||
|
@ -69,4 +69,10 @@ gboolean meta_wayland_seat_get_grab_info (MetaWaylandSeat *seat,
|
|||||||
gboolean meta_wayland_seat_can_popup (MetaWaylandSeat *seat,
|
gboolean meta_wayland_seat_can_popup (MetaWaylandSeat *seat,
|
||||||
uint32_t serial);
|
uint32_t serial);
|
||||||
|
|
||||||
|
gboolean meta_wayland_seat_has_keyboard (MetaWaylandSeat *seat);
|
||||||
|
|
||||||
|
gboolean meta_wayland_seat_has_pointer (MetaWaylandSeat *seat);
|
||||||
|
|
||||||
|
gboolean meta_wayland_seat_has_touch (MetaWaylandSeat *seat);
|
||||||
|
|
||||||
#endif /* META_WAYLAND_SEAT_H */
|
#endif /* META_WAYLAND_SEAT_H */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user