Commit 1c856a20 authored by Emmanuele Bassi's avatar Emmanuele Bassi 👣
Browse files

Rename master and slave device

We already use the "logical/virtual" and "physical" names in the
documentation, there's no reason to use loaded terms just because X11
uses them.
parent c7916c8e
Pipeline #189472 passed with stages
in 35 minutes and 23 seconds
......@@ -359,7 +359,7 @@ gdk_device_get_product_id
gdk_device_get_source
gdk_device_get_axis_use
gdk_device_get_associated_device
gdk_device_list_slave_devices
gdk_device_list_physical_devices
gdk_device_get_device_type
gdk_device_get_display
gdk_device_get_has_cursor
......@@ -442,8 +442,8 @@ gdk_seat_get_display
gdk_seat_get_capabilities
gdk_seat_get_pointer
gdk_seat_get_keyboard
gdk_seat_get_slaves
gdk_seat_get_master_pointers
gdk_seat_get_physical_devices
gdk_seat_get_logical_pointers
<SUBSECTION Standard>
GDK_SEAT
......
......@@ -5,7 +5,7 @@ in what happens to translate a key press or mouse motion of the users into a
change of a GTK widget, you should read this chapter. This knowledge will also
be useful if you decide to implement your own widgets.
Devices and events
## Devices and events
The most basic input devices that every computer user has interacted with are
keyboards and mice; beyond these, GTK supports touchpads, touchscreens and
......@@ -13,14 +13,14 @@ more exotic input devices such as graphics tablets. Inside GTK, every such
input device is represented by a #GdkDevice object.
To simplify dealing with the variability between these input devices, GTK
has a concept of master and slave devices. The concrete physical devices that
has a concept of logical and physical devices. The concrete physical devices that
have many different characteristics (mice may have 2 or 3 or 8 buttons,
keyboards have different layouts and may or may not have a separate number
block, etc) are represented as slave devices. Each slave device is
associated with a virtual master device. Master devices always come in
block, etc) are represented as physical devices. Each physical device is
associated with a virtual logical device. Logical devices always come in
pointer/keyboard pairs - you can think of such a pair as a 'seat'.
GTK widgets generally deal with the master devices, and thus can be used
GTK widgets generally deal with the logical devices, and thus can be used
with any pointing device or keyboard.
When a user interacts with an input device (e.g. moves a mouse or presses
......
......@@ -157,7 +157,7 @@ _gdk_broadway_surface_grab_check_unmap (GdkSurface *surface,
seat = gdk_display_get_default_seat (display);
devices = gdk_seat_get_slaves (seat, GDK_SEAT_CAPABILITY_ALL);
devices = gdk_seat_get_physical_devices (seat, GDK_SEAT_CAPABILITY_ALL);
devices = g_list_prepend (devices, gdk_seat_get_keyboard (seat));
devices = g_list_prepend (devices, gdk_seat_get_pointer (seat));
......
......@@ -119,7 +119,7 @@ create_core_pointer (GdkDisplay *display)
{
return g_object_new (GDK_TYPE_BROADWAY_DEVICE,
"name", "Core Pointer",
"type", GDK_DEVICE_TYPE_MASTER,
"type", GDK_DEVICE_TYPE_LOGICAL,
"source", GDK_SOURCE_MOUSE,
"has-cursor", TRUE,
"display", display,
......@@ -131,7 +131,7 @@ create_core_keyboard (GdkDisplay *display)
{
return g_object_new (GDK_TYPE_BROADWAY_DEVICE,
"name", "Core Keyboard",
"type", GDK_DEVICE_TYPE_MASTER,
"type", GDK_DEVICE_TYPE_LOGICAL,
"source", GDK_SOURCE_KEYBOARD,
"has-cursor", FALSE,
"display", display,
......@@ -143,7 +143,7 @@ create_pointer (GdkDisplay *display)
{
return g_object_new (GDK_TYPE_BROADWAY_DEVICE,
"name", "Pointer",
"type", GDK_DEVICE_TYPE_SLAVE,
"type", GDK_DEVICE_TYPE_PHYSICAL,
"source", GDK_SOURCE_MOUSE,
"has-cursor", TRUE,
"display", display,
......@@ -155,7 +155,7 @@ create_keyboard (GdkDisplay *display)
{
return g_object_new (GDK_TYPE_BROADWAY_DEVICE,
"name", "Keyboard",
"type", GDK_DEVICE_TYPE_SLAVE,
"type", GDK_DEVICE_TYPE_PHYSICAL,
"source", GDK_SOURCE_KEYBOARD,
"has-cursor", FALSE,
"display", display,
......@@ -167,7 +167,7 @@ create_touchscreen (GdkDisplay *display)
{
return g_object_new (GDK_TYPE_BROADWAY_DEVICE,
"name", "Touchscreen",
"type", GDK_DEVICE_TYPE_SLAVE,
"type", GDK_DEVICE_TYPE_PHYSICAL,
"source", GDK_SOURCE_TOUCHSCREEN,
"has-cursor", FALSE,
"display", display,
......@@ -196,15 +196,15 @@ _gdk_broadway_display_open (const gchar *display_name)
_gdk_device_set_associated_device (broadway_display->pointer, broadway_display->core_pointer);
_gdk_device_set_associated_device (broadway_display->keyboard, broadway_display->core_keyboard);
_gdk_device_set_associated_device (broadway_display->touchscreen, broadway_display->core_pointer);
_gdk_device_add_slave (broadway_display->core_pointer, broadway_display->touchscreen);
_gdk_device_add_physical_device (broadway_display->core_pointer, broadway_display->touchscreen);
seat = gdk_seat_default_new_for_master_pair (broadway_display->core_pointer,
broadway_display->core_keyboard);
seat = gdk_seat_default_new_for_logical_pair (broadway_display->core_pointer,
broadway_display->core_keyboard);
gdk_display_add_seat (display, seat);
gdk_seat_default_add_slave (GDK_SEAT_DEFAULT (seat), broadway_display->pointer);
gdk_seat_default_add_slave (GDK_SEAT_DEFAULT (seat), broadway_display->keyboard);
gdk_seat_default_add_slave (GDK_SEAT_DEFAULT (seat), broadway_display->touchscreen);
gdk_seat_default_add_physical_device (GDK_SEAT_DEFAULT (seat), broadway_display->pointer);
gdk_seat_default_add_physical_device (GDK_SEAT_DEFAULT (seat), broadway_display->keyboard);
gdk_seat_default_add_physical_device (GDK_SEAT_DEFAULT (seat), broadway_display->touchscreen);
g_object_unref (seat);
gdk_event_init (display);
......
......@@ -36,7 +36,7 @@
* as a keyboard, a mouse, a touchpad, etc.
*
* See the #GdkSeat documentation for more information
* about the various kinds of master and slave devices, and their
* about the various kinds of logical and physical devices, and their
* relationships.
*/
......@@ -152,15 +152,16 @@ gdk_device_class_init (GdkDeviceClass *klass)
P_("Device type"),
P_("Device role in the device manager"),
GDK_TYPE_DEVICE_TYPE,
GDK_DEVICE_TYPE_MASTER,
GDK_DEVICE_TYPE_LOGICAL,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS);
/**
* GdkDevice:associated-device:
*
* Associated pointer or keyboard with this device, if any. Devices of type #GDK_DEVICE_TYPE_MASTER
* always come in keyboard/pointer pairs. Other device types will have a %NULL associated device.
* Associated pointer or keyboard with this device, if any. Devices of
* type #GDK_DEVICE_TYPE_LOGICAL always come in keyboard/pointer pairs.
* Other device types will have a %NULL associated device.
*/
device_props[PROP_ASSOCIATED_DEVICE] =
g_param_spec_object ("associated-device",
......@@ -187,7 +188,7 @@ gdk_device_class_init (GdkDeviceClass *klass)
* GdkDevice:has-cursor:
*
* Whether the device is represented by a cursor on the screen. Devices of type
* %GDK_DEVICE_TYPE_MASTER will have %TRUE here.
* %GDK_DEVICE_TYPE_LOGICAL will have %TRUE here.
*/
device_props[PROP_HAS_CURSOR] =
g_param_spec_boolean ("has-cursor",
......@@ -333,11 +334,11 @@ gdk_device_class_init (GdkDeviceClass *klass)
*
* The ::changed signal is emitted either when the #GdkDevice
* has changed the number of either axes or keys. For example
* In X this will normally happen when the slave device routing
* events through the master device changes (for example, user
* switches from the USB mouse to a tablet), in that case the
* master device will change to reflect the new slave device
* axes and keys.
* on X11 this will normally happen when the physical device
* routing events through the logical device changes (for
* example, user switches from the USB mouse to a tablet); in
* that case the logical device will change to reflect the axes
* and keys on the new physical device.
*/
signals[CHANGED] =
g_signal_new (g_intern_static_string ("changed"),
......@@ -394,14 +395,14 @@ gdk_device_dispose (GObject *object)
GdkDevice *device = GDK_DEVICE (object);
GdkDevice *associated = device->associated;
if (associated && device->type == GDK_DEVICE_TYPE_SLAVE)
_gdk_device_remove_slave (associated, device);
if (associated && device->type == GDK_DEVICE_TYPE_PHYSICAL)
_gdk_device_remove_physical_device (associated, device);
if (associated)
{
device->associated = NULL;
if (device->type == GDK_DEVICE_TYPE_MASTER &&
if (device->type == GDK_DEVICE_TYPE_LOGICAL &&
associated->associated == device)
_gdk_device_set_associated_device (associated, NULL);
......@@ -539,21 +540,23 @@ gdk_device_get_property (GObject *object,
* the axes of @device in, or %NULL.
* @mask: (optional) (out): location to store the modifiers, or %NULL.
*
* Gets the current state of a pointer device relative to @surface. As a slave
* device’s coordinates are those of its master pointer, this
* function may not be called on devices of type %GDK_DEVICE_TYPE_SLAVE,
* unless there is an ongoing grab on them. See gdk_seat_grab().
* Gets the current state of a pointer device relative to @surface. As a
* physical device’s coordinates are those of its logical pointer, this
* function may not be called on devices of type %GDK_DEVICE_TYPE_PHYSICAL,
* unless there is an ongoing grab on them.
*
* See also: gdk_seat_grab().
*/
void
gdk_device_get_state (GdkDevice *device,
GdkSurface *surface,
GdkSurface *surface,
gdouble *axes,
GdkModifierType *mask)
{
g_return_if_fail (GDK_IS_DEVICE (device));
g_return_if_fail (device->source != GDK_SOURCE_KEYBOARD);
g_return_if_fail (GDK_IS_SURFACE (surface));
g_return_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_SLAVE ||
g_return_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_PHYSICAL ||
gdk_display_device_is_grabbed (gdk_device_get_display (device), device));
if (GDK_DEVICE_GET_CLASS (device)->get_state)
......@@ -575,7 +578,7 @@ gdk_device_get_position (GdkDevice *device,
{
g_return_if_fail (GDK_IS_DEVICE (device));
g_return_if_fail (device->source != GDK_SOURCE_KEYBOARD);
g_return_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_SLAVE ||
g_return_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_PHYSICAL ||
gdk_display_device_is_grabbed (gdk_device_get_display (device), device));
_gdk_device_query_state (device, NULL, NULL, x, y, NULL);
......@@ -593,8 +596,8 @@ gdk_device_get_position (GdkDevice *device,
* double precision. Returns %NULL if the surface tree under @device is not known to GDK (for example,
* belongs to another application).
*
* As a slave device coordinates are those of its master pointer, This
* function may not be called on devices of type %GDK_DEVICE_TYPE_SLAVE,
* As a physical device coordinates are those of its logical pointer, this
* function may not be called on devices of type %GDK_DEVICE_TYPE_PHYSICAL,
* unless there is an ongoing grab on them, see gdk_seat_grab().
*
* Returns: (nullable) (transfer none): the #GdkSurface under the
......@@ -610,7 +613,7 @@ gdk_device_get_surface_at_position (GdkDevice *device,
g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
g_return_val_if_fail (device->source != GDK_SOURCE_KEYBOARD, NULL);
g_return_val_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_SLAVE ||
g_return_val_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_PHYSICAL ||
gdk_display_device_is_grabbed (gdk_device_get_display (device), device), NULL);
surface = _gdk_device_surface_at_position (device, &tmp_x, &tmp_y, NULL);
......@@ -717,15 +720,14 @@ gdk_device_get_display (GdkDevice *device)
* gdk_device_get_associated_device:
* @device: a #GdkDevice
*
* Returns the associated device to @device, if @device is of type
* %GDK_DEVICE_TYPE_MASTER, it will return the paired pointer or
* keyboard.
*
* If @device is of type %GDK_DEVICE_TYPE_SLAVE, it will return
* the master device to which @device is attached to.
* Returns the #GdkDevice associated to @device:
*
* If @device is of type %GDK_DEVICE_TYPE_FLOATING, %NULL will be
* returned, as there is no associated device.
* - if @device is of type %GDK_DEVICE_TYPE_LOGICAL, it will return
* the paired pointer or keyboard.
* - if @device is of type %GDK_DEVICE_TYPE_PHYSICAL, it will return
* the logical device to which @device is attached to.
* - if @device is of type %GDK_DEVICE_TYPE_FLOATING, %NULL will be
* returned, as there is no associated device.
*
* Returns: (nullable) (transfer none): The associated device, or
* %NULL
......@@ -769,63 +771,59 @@ _gdk_device_set_associated_device (GdkDevice *device,
if (associated)
device->associated = g_object_ref (associated);
if (device->type != GDK_DEVICE_TYPE_MASTER)
if (device->type != GDK_DEVICE_TYPE_LOGICAL)
{
if (device->associated)
_gdk_device_set_device_type (device, GDK_DEVICE_TYPE_SLAVE);
_gdk_device_set_device_type (device, GDK_DEVICE_TYPE_PHYSICAL);
else
_gdk_device_set_device_type (device, GDK_DEVICE_TYPE_FLOATING);
}
}
/**
* gdk_device_list_slave_devices:
* @device: a #GdkDevice
* gdk_device_list_physical_devices:
* @device: a logical #GdkDevice
*
* If the device if of type %GDK_DEVICE_TYPE_MASTER, it will return
* the list of slave devices attached to it, otherwise it will return
* %NULL
* Returns the list of physical devices attached to the given logical
* #GdkDevice.
*
* Returns: (nullable) (transfer container) (element-type GdkDevice):
* the list of slave devices, or %NULL. The list must be
* freed with g_list_free(), the contents of the list are
* owned by GTK+ and should not be freed.
**/
* the list of physical devices attached to a logical #GdkDevice
*/
GList *
gdk_device_list_slave_devices (GdkDevice *device)
gdk_device_list_physical_devices (GdkDevice *device)
{
g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
g_return_val_if_fail (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_MASTER, NULL);
g_return_val_if_fail (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_LOGICAL, NULL);
return g_list_copy (device->slaves);
return g_list_copy (device->physical_devices);
}
void
_gdk_device_add_slave (GdkDevice *device,
GdkDevice *slave)
_gdk_device_add_physical_device (GdkDevice *device,
GdkDevice *physical)
{
g_return_if_fail (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_MASTER);
g_return_if_fail (gdk_device_get_device_type (slave) != GDK_DEVICE_TYPE_MASTER);
g_return_if_fail (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_LOGICAL);
g_return_if_fail (gdk_device_get_device_type (physical) != GDK_DEVICE_TYPE_LOGICAL);
if (!g_list_find (device->slaves, slave))
device->slaves = g_list_prepend (device->slaves, slave);
if (!g_list_find (device->physical_devices, physical))
device->physical_devices = g_list_prepend (device->physical_devices, physical);
}
void
_gdk_device_remove_slave (GdkDevice *device,
GdkDevice *slave)
_gdk_device_remove_physical_device (GdkDevice *device,
GdkDevice *physical)
{
GList *elem;
g_return_if_fail (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_MASTER);
g_return_if_fail (gdk_device_get_device_type (slave) != GDK_DEVICE_TYPE_MASTER);
elem = g_list_find (device->slaves, slave);
g_return_if_fail (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_LOGICAL);
g_return_if_fail (gdk_device_get_device_type (physical) != GDK_DEVICE_TYPE_LOGICAL);
if (!elem)
elem = g_list_find (device->physical_devices, physical);
if (elem == NULL)
return;
device->slaves = g_list_delete_link (device->slaves, elem);
device->physical_devices = g_list_delete_link (device->physical_devices, elem);
}
/**
......@@ -839,7 +837,7 @@ _gdk_device_remove_slave (GdkDevice *device,
GdkDeviceType
gdk_device_get_device_type (GdkDevice *device)
{
g_return_val_if_fail (GDK_IS_DEVICE (device), GDK_DEVICE_TYPE_MASTER);
g_return_val_if_fail (GDK_IS_DEVICE (device), GDK_DEVICE_TYPE_LOGICAL);
return device->type;
}
......@@ -1315,7 +1313,7 @@ gdk_device_get_last_event_surface (GdkDevice *device)
/**
* gdk_device_get_vendor_id:
* @device: a slave #GdkDevice
* @device: a physical #GdkDevice
*
* Returns the vendor ID of this device, or %NULL if this information couldn't
* be obtained. This ID is retrieved from the device, and is thus constant for
......@@ -1350,14 +1348,14 @@ const gchar *
gdk_device_get_vendor_id (GdkDevice *device)
{
g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
g_return_val_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_MASTER, NULL);
g_return_val_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_LOGICAL, NULL);
return device->vendor_id;
}
/**
* gdk_device_get_product_id:
* @device: a slave #GdkDevice
* @device: a physical #GdkDevice
*
* Returns the product ID of this device, or %NULL if this information couldn't
* be obtained. This ID is retrieved from the device, and is thus constant for
......@@ -1369,7 +1367,7 @@ const gchar *
gdk_device_get_product_id (GdkDevice *device)
{
g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
g_return_val_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_MASTER, NULL);
g_return_val_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_LOGICAL, NULL);
return device->product_id;
}
......@@ -1424,7 +1422,7 @@ gdk_device_update_tool (GdkDevice *device,
GdkDeviceTool *tool)
{
g_return_if_fail (GDK_IS_DEVICE (device));
g_return_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_MASTER);
g_return_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_LOGICAL);
if (g_set_object (&device->last_tool, tool))
{
......
......@@ -71,17 +71,17 @@ typedef enum
/**
* GdkDeviceType:
* @GDK_DEVICE_TYPE_MASTER: Device is a master (or virtual) device. There will
* be an associated focus indicator on the screen.
* @GDK_DEVICE_TYPE_SLAVE: Device is a slave (or physical) device.
* @GDK_DEVICE_TYPE_FLOATING: Device is a physical device, currently not attached to
* any seat.
* @GDK_DEVICE_TYPE_LOGICAL: Device is a logical device. There will
* be an associated focus indicator on the screen.
* @GDK_DEVICE_TYPE_PHYSICAL: Device is a physical device.
* @GDK_DEVICE_TYPE_FLOATING: Device is a physical device, currently
* not attached to any seat.
*
* Indicates the device type.
*/
typedef enum {
GDK_DEVICE_TYPE_MASTER,
GDK_DEVICE_TYPE_SLAVE,
GDK_DEVICE_TYPE_LOGICAL,
GDK_DEVICE_TYPE_PHYSICAL,
GDK_DEVICE_TYPE_FLOATING
} GdkDeviceType;
......@@ -141,7 +141,7 @@ GdkDisplay * gdk_device_get_display (GdkDevice *device);
GDK_AVAILABLE_IN_ALL
GdkDevice * gdk_device_get_associated_device (GdkDevice *device);
GDK_AVAILABLE_IN_ALL
GList * gdk_device_list_slave_devices (GdkDevice *device);
GList * gdk_device_list_physical_devices (GdkDevice *device);
GDK_AVAILABLE_IN_ALL
GdkDeviceType gdk_device_get_device_type (GdkDevice *device);
......
......@@ -41,11 +41,11 @@ struct _GdkDevice
gboolean has_cursor;
GdkAxisFlags axis_flags;
GdkDisplay *display;
/* Paired master for master,
* associated master for slaves
/* The paired logical device for logical devices,
* or the associated logical device for physical ones
*/
GdkDevice *associated;
GList *slaves;
GList *physical_devices;
GdkDeviceType type;
GArray *axes;
guint num_touches;
......@@ -132,10 +132,11 @@ gboolean _gdk_device_translate_axis (GdkDevice *device,
GdkTimeCoord ** _gdk_device_allocate_history (GdkDevice *device,
gint n_events);
void _gdk_device_add_slave (GdkDevice *device,
GdkDevice *slave);
void _gdk_device_remove_slave (GdkDevice *device,
GdkDevice *slave);
void _gdk_device_add_physical_device (GdkDevice *device,
GdkDevice *physical);
void _gdk_device_remove_physical_device (GdkDevice *device,
GdkDevice *physical);
void _gdk_device_query_state (GdkDevice *device,
GdkSurface *surface,
GdkSurface **child_surface,
......
......@@ -643,12 +643,12 @@ switch_to_pointer_grab (GdkDisplay *display,
if (grab == NULL /* ungrab */ ||
(!last_grab->owner_events && grab->owner_events) /* switched to owner_events */ )
{
/* Ungrabbed slave devices don't have a position by
* itself, rather depend on its master pointer, so
/* Ungrabbed physical devices don't have a position by
* itself, rather depend on its logical pointer, so
* it doesn't make sense to track any position for
* these after the grab
*/
if (grab || gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_SLAVE)
if (grab || gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_PHYSICAL)
new_toplevel = get_current_toplevel (display, device, &x, &y, &state);
if (new_toplevel)
......
......@@ -66,7 +66,7 @@ typedef struct
gdouble toplevel_x, toplevel_y;
guint32 state;
guint32 button;
GdkDevice *last_slave;
GdkDevice *last_physical_device;
} GdkPointerSurfaceInfo;
struct _GdkDisplay
......
......@@ -1205,9 +1205,9 @@ gdk_event_get_device (GdkEvent *event)
* gdk_event_get_source_device:
* @event: a #GdkEvent
*
* This function returns the hardware (slave) #GdkDevice that has
* triggered the event, falling back to the virtual (master) device
* (as in gdk_event_get_device()) if the event wasn’t caused by
* This function returns the physical #GdkDevice that has triggered
* the event, falling back to the logical device, as returned by
* gdk_event_get_device(), if the event wasn’t caused by
* interaction with a hardware device. This may happen for example
* in synthesized crossing events after a #GdkSurface updates its
* geometry or a grab is acquired/released.
......
......@@ -323,35 +323,35 @@ gdk_seat_ungrab (GdkSeat *seat)
}
/**
* gdk_seat_get_slaves:
* gdk_seat_get_physical_devices:
* @seat: a #GdkSeat
* @capabilities: capabilities to get devices for
*
* Returns the slave devices that match the given capabilities.
* Returns the physical devices that match the given capabilities.
*
* Returns: (transfer container) (element-type GdkDevice): A list of #GdkDevices.
* The list must be freed with g_list_free(), the elements are owned
* by GDK and must not be freed.
**/
GList *
gdk_seat_get_slaves (GdkSeat *seat,
GdkSeatCapabilities capabilities)
gdk_seat_get_physical_devices (GdkSeat *seat,
GdkSeatCapabilities capabilities)
{
GdkSeatClass *seat_class;
g_return_val_if_fail (GDK_IS_SEAT (seat), NULL);
seat_class = GDK_SEAT_GET_CLASS (seat);
return seat_class->get_slaves (seat, capabilities);
return seat_class->get_physical_devices (seat, capabilities);
}
/**
* gdk_seat_get_pointer:
* @seat: a #GdkSeat
*
* Returns the master device that routes pointer events.
* Returns the logical device that routes pointer events.
*
* Returns: (transfer none) (nullable): a master #GdkDevice with pointer
* Returns: (transfer none) (nullable): a logical #GdkDevice with pointer
* capabilities. This object is owned by GTK and must not be freed.
**/
GdkDevice *
......@@ -362,16 +362,16 @@ gdk_seat_get_pointer (GdkSeat *seat)
g_return_val_if_fail (GDK_IS_SEAT (seat), NULL);
seat_class = GDK_SEAT_GET_CLASS (seat);
return seat_class->get_master (seat, GDK_SEAT_CAPABILITY_POINTER);
return seat_class->get_logical_device (seat, GDK_SEAT_CAPABILITY_POINTER);
}
/**
* gdk_seat_get_keyboard:
* @seat: a #GdkSeat
*
* Returns the master device that routes keyboard events.
* Returns the logical device that routes keyboard events.
*
* Returns: (transfer none) (nullable): a master #GdkDevice with keyboard
* Returns: (transfer none) (nullable): a logical #GdkDevice with keyboard
* capabilities. This object is owned by GTK and must not be freed.
**/
GdkDevice *
......@@ -382,7 +382,7 @@ gdk_seat_get_keyboard (GdkSeat *seat)
g_return_val_if_fail (GDK_IS_SEAT (seat), NULL);
seat_class = GDK_SEAT_GET_CLASS (seat);
return seat_class->get_master (seat, GDK_SEAT_CAPABILITY_KEYBOARD);
return seat_class->get_logical_device (seat, GDK_SEAT_CAPABILITY_KEYBOARD);
}
void
......@@ -448,25 +448,29 @@ gdk_seat_get_tool (GdkSeat *seat,
}
/**
* gdk_seat_get_master_pointers:
* gdk_seat_get_logical_pointers:
* @seat: The #GdkSeat
* @capabilities: Queried capabilities
*
* Returns all master pointers with the given capabilities driven by this @seat.
* On most backends this function will return a list with a single element (meaning
* that all input devices drive the same onscreen cursor).
* Returns all logical pointers with the given capabilities driven by
* this @seat.
*
* In other backends where there can possibly be multiple foci (eg. wayland),
* this function will return all master #GdkDevices that represent these.
* On most windowing system backends this function will return a list
* with a single element (meaning that all input devices drive the same
* on-screen cursor).
*
* In other windowing systems where there can possibly be multiple
* foci (e.g. Wayland), this function will return all logical #GdkDevices
* that represent these.
*
* Returns: (transfer container) (element-type GdkDevice): A list
* of master pointing devices
* of logical pointing devices
*/
GList *
gdk_seat_get_master_pointers (GdkSeat *seat,
GdkSeatCapabilities capabilities)
gdk_seat_get_logical_pointers (GdkSeat *seat,
GdkSeatCapabilities capabilities)
{
g_return_val_if_fail (GDK_IS_SEAT (seat), NULL);
return GDK_SEAT_GET_CLASS (seat)->get_master_pointers (seat, capabilities);