clutter/backends: Rename master and slave devices

Just because X11/XI uses a particular terminology doesn't mean we
have to use the same terms in our own API. The replacement terms
are in line with gtk@1c856a208, which seems a better precedent
for consistency.

Follow-up to commit 17417a82a5.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1425
This commit is contained in:
Florian Müllner 2020-08-31 18:47:23 +02:00
parent c1c061140f
commit 6b04b2ff60
16 changed files with 136 additions and 136 deletions

View File

@ -1035,11 +1035,11 @@ typedef enum
/**
* ClutterInputMode:
* @CLUTTER_INPUT_MODE_MASTER: A master, virtual device
* @CLUTTER_INPUT_MODE_SLAVE: A slave, physical device, attached to
* a master device
* @CLUTTER_INPUT_MODE_FLOATING: A slave, physical device, not attached
* to a master device
* @CLUTTER_INPUT_MODE_LOGICAL: A logical, virtual device
* @CLUTTER_INPUT_MODE_PHYSICAL: A physical device, attached to
* a logical device
* @CLUTTER_INPUT_MODE_FLOATING: A physical device, not attached
* to a logical device
*
* The mode for input devices available.
*
@ -1047,8 +1047,8 @@ typedef enum
*/
typedef enum
{
CLUTTER_INPUT_MODE_MASTER,
CLUTTER_INPUT_MODE_SLAVE,
CLUTTER_INPUT_MODE_LOGICAL,
CLUTTER_INPUT_MODE_PHYSICAL,
CLUTTER_INPUT_MODE_FLOATING
} ClutterInputMode;

View File

@ -105,7 +105,7 @@ struct _ClutterInputDevice
/* the associated device */
ClutterInputDevice *associated;
GList *slaves;
GList *physical_devices;
/* the actor underneath the pointer */
ClutterActor *cursor_actor;
@ -171,11 +171,11 @@ CLUTTER_EXPORT
void _clutter_input_device_set_associated_device (ClutterInputDevice *device,
ClutterInputDevice *associated);
CLUTTER_EXPORT
void _clutter_input_device_add_slave (ClutterInputDevice *master,
ClutterInputDevice *slave);
void _clutter_input_device_add_physical_device (ClutterInputDevice *logical,
ClutterInputDevice *physical);
CLUTTER_EXPORT
void _clutter_input_device_remove_slave (ClutterInputDevice *master,
ClutterInputDevice *slave);
void _clutter_input_device_remove_physical_device (ClutterInputDevice *logical,
ClutterInputDevice *physical);
CLUTTER_EXPORT
void clutter_input_device_update_from_tool (ClutterInputDevice *device,
ClutterInputDeviceTool *tool);

View File

@ -100,8 +100,8 @@ clutter_input_device_dispose (GObject *gobject)
if (device->associated != NULL)
{
if (device->device_mode == CLUTTER_INPUT_MODE_SLAVE)
_clutter_input_device_remove_slave (device->associated, device);
if (device->device_mode == CLUTTER_INPUT_MODE_PHYSICAL)
_clutter_input_device_remove_physical_device (device->associated, device);
_clutter_input_device_set_associated_device (device->associated, NULL);
g_object_unref (device->associated);
@ -408,7 +408,7 @@ clutter_input_device_class_init (ClutterInputDeviceClass *klass)
* Whether the device is enabled.
*
* A device with the #ClutterInputDevice:device-mode property set
* to %CLUTTER_INPUT_MODE_MASTER cannot be disabled.
* to %CLUTTER_INPUT_MODE_LOGICAL cannot be disabled.
*
* A device must be enabled in order to receive events from it.
*
@ -915,7 +915,7 @@ clutter_input_device_get_device_id (ClutterInputDevice *device)
* Enables or disables a #ClutterInputDevice.
*
* Only devices with a #ClutterInputDevice:device-mode property set
* to %CLUTTER_INPUT_MODE_SLAVE or %CLUTTER_INPUT_MODE_FLOATING can
* to %CLUTTER_INPUT_MODE_PHYSICAL or %CLUTTER_INPUT_MODE_FLOATING can
* be disabled.
*
* Since: 1.6
@ -928,7 +928,7 @@ clutter_input_device_set_enabled (ClutterInputDevice *device,
enabled = !!enabled;
if (!enabled && device->device_mode == CLUTTER_INPUT_MODE_MASTER)
if (!enabled && device->device_mode == CLUTTER_INPUT_MODE_LOGICAL)
return;
if (device->is_enabled == enabled)
@ -1611,39 +1611,39 @@ clutter_input_device_get_key (ClutterInputDevice *device,
}
/*< private >
* clutter_input_device_add_slave:
* @master: a #ClutterInputDevice
* @slave: a #ClutterInputDevice
* clutter_input_device_add_physical_device:
* @logical: a #ClutterInputDevice
* @physical: a #ClutterInputDevice
*
* Adds @slave to the list of slave devices of @master
* Adds @physical to the list of physical devices of @logical
*
* This function does not increase the reference count of either @master
* or @slave.
* This function does not increase the reference count of either @logical
* or @physical.
*/
void
_clutter_input_device_add_slave (ClutterInputDevice *master,
ClutterInputDevice *slave)
_clutter_input_device_add_physical_device (ClutterInputDevice *logical,
ClutterInputDevice *physical)
{
if (g_list_find (master->slaves, slave) == NULL)
master->slaves = g_list_prepend (master->slaves, slave);
if (g_list_find (logical->physical_devices, physical) == NULL)
logical->physical_devices = g_list_prepend (logical->physical_devices, physical);
}
/*< private >
* clutter_input_device_remove_slave:
* @master: a #ClutterInputDevice
* @slave: a #ClutterInputDevice
* clutter_input_device_remove_physical_device:
* @logical: a #ClutterInputDevice
* @physical: a #ClutterInputDevice
*
* Removes @slave from the list of slave devices of @master.
* Removes @physical from the list of physical devices of @logical.
*
* This function does not decrease the reference count of either @master
* or @slave.
* This function does not decrease the reference count of either @logical
* or @physical.
*/
void
_clutter_input_device_remove_slave (ClutterInputDevice *master,
ClutterInputDevice *slave)
_clutter_input_device_remove_physical_device (ClutterInputDevice *logical,
ClutterInputDevice *physical)
{
if (g_list_find (master->slaves, slave) != NULL)
master->slaves = g_list_remove (master->slaves, slave);
if (g_list_find (logical->physical_devices, physical) != NULL)
logical->physical_devices = g_list_remove (logical->physical_devices, physical);
}
/*< private >
@ -1705,10 +1705,10 @@ _clutter_input_device_remove_event_sequence (ClutterInputDevice *device,
}
/**
* clutter_input_device_get_slave_devices:
* clutter_input_device_get_physical_devices:
* @device: a #ClutterInputDevice
*
* Retrieves the slave devices attached to @device.
* Retrieves the physical devices attached to @device.
*
* Return value: (transfer container) (element-type Clutter.InputDevice): a
* list of #ClutterInputDevice, or %NULL. The contents of the list are
@ -1717,11 +1717,11 @@ _clutter_input_device_remove_event_sequence (ClutterInputDevice *device,
* Since: 1.6
*/
GList *
clutter_input_device_get_slave_devices (ClutterInputDevice *device)
clutter_input_device_get_physical_devices (ClutterInputDevice *device)
{
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), NULL);
return g_list_copy (device->slaves);
return g_list_copy (device->physical_devices);
}
/*< internal >
@ -1757,10 +1757,10 @@ _clutter_input_device_set_associated_device (ClutterInputDevice *device,
? clutter_input_device_get_device_name (device->associated)
: "(none)");
if (device->device_mode != CLUTTER_INPUT_MODE_MASTER)
if (device->device_mode != CLUTTER_INPUT_MODE_LOGICAL)
{
if (device->associated != NULL)
device->device_mode = CLUTTER_INPUT_MODE_SLAVE;
device->device_mode = CLUTTER_INPUT_MODE_PHYSICAL;
else
device->device_mode = CLUTTER_INPUT_MODE_FLOATING;
@ -1776,7 +1776,7 @@ _clutter_input_device_set_associated_device (ClutterInputDevice *device,
* associated to @device.
*
* If the #ClutterInputDevice:device-mode property of @device is
* set to %CLUTTER_INPUT_MODE_MASTER, this function will return
* set to %CLUTTER_INPUT_MODE_LOGICAL, this function will return
* %NULL.
*
* Return value: (transfer none): a #ClutterInputDevice, or %NULL
@ -2210,7 +2210,7 @@ clutter_input_device_sequence_get_grabbed_actor (ClutterInputDevice *device,
/**
* clutter_input_device_get_vendor_id:
* @device: a slave #ClutterInputDevice
* @device: a physical #ClutterInputDevice
*
* Gets the vendor ID of this device.
*
@ -2222,14 +2222,14 @@ const gchar *
clutter_input_device_get_vendor_id (ClutterInputDevice *device)
{
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), NULL);
g_return_val_if_fail (clutter_input_device_get_device_mode (device) != CLUTTER_INPUT_MODE_MASTER, NULL);
g_return_val_if_fail (clutter_input_device_get_device_mode (device) != CLUTTER_INPUT_MODE_LOGICAL, NULL);
return device->vendor_id;
}
/**
* clutter_input_device_get_product_id:
* @device: a slave #ClutterInputDevice
* @device: a physical #ClutterInputDevice
*
* Gets the product ID of this device.
*
@ -2241,7 +2241,7 @@ const gchar *
clutter_input_device_get_product_id (ClutterInputDevice *device)
{
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), NULL);
g_return_val_if_fail (clutter_input_device_get_device_mode (device) != CLUTTER_INPUT_MODE_MASTER, NULL);
g_return_val_if_fail (clutter_input_device_get_device_mode (device) != CLUTTER_INPUT_MODE_LOGICAL, NULL);
return device->product_id;
}
@ -2251,7 +2251,7 @@ clutter_input_device_add_tool (ClutterInputDevice *device,
ClutterInputDeviceTool *tool)
{
g_return_if_fail (CLUTTER_IS_INPUT_DEVICE (device));
g_return_if_fail (clutter_input_device_get_device_mode (device) != CLUTTER_INPUT_MODE_MASTER);
g_return_if_fail (clutter_input_device_get_device_mode (device) != CLUTTER_INPUT_MODE_LOGICAL);
g_return_if_fail (CLUTTER_IS_INPUT_DEVICE_TOOL (tool));
if (!device->tools)
@ -2269,7 +2269,7 @@ clutter_input_device_lookup_tool (ClutterInputDevice *device,
guint i;
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), NULL);
g_return_val_if_fail (clutter_input_device_get_device_mode (device) != CLUTTER_INPUT_MODE_MASTER, NULL);
g_return_val_if_fail (clutter_input_device_get_device_mode (device) != CLUTTER_INPUT_MODE_LOGICAL, NULL);
if (!device->tools)
return NULL;

View File

@ -135,7 +135,7 @@ gboolean clutter_input_device_get_key (ClutterInputDev
CLUTTER_EXPORT
ClutterInputDevice * clutter_input_device_get_associated_device (ClutterInputDevice *device);
CLUTTER_EXPORT
GList * clutter_input_device_get_slave_devices (ClutterInputDevice *device);
GList * clutter_input_device_get_physical_devices (ClutterInputDevice *device);
CLUTTER_EXPORT
void clutter_input_device_update_from_event (ClutterInputDevice *device,

View File

@ -326,9 +326,9 @@ clutter_seat_init (ClutterSeat *seat)
* clutter_seat_get_pointer:
* @seat: a #ClutterSeat
*
* Returns the master pointer
* Returns the logical pointer
*
* Returns: (transfer none): the master pointer
* Returns: (transfer none): the logical pointer
**/
ClutterInputDevice *
clutter_seat_get_pointer (ClutterSeat *seat)
@ -342,9 +342,9 @@ clutter_seat_get_pointer (ClutterSeat *seat)
* clutter_seat_get_keyboard:
* @seat: a #ClutterSeat
*
* Returns the master keyboard
* Returns the logical keyboard
*
* Returns: (transfer none): the master keyboard
* Returns: (transfer none): the logical keyboard
**/
ClutterInputDevice *
clutter_seat_get_keyboard (ClutterSeat *seat)

View File

@ -1284,7 +1284,7 @@ clutter_stage_find_updated_devices (ClutterStage *stage)
const cairo_region_t *clip;
if (clutter_input_device_get_device_mode (dev) !=
CLUTTER_INPUT_MODE_MASTER)
CLUTTER_INPUT_MODE_LOGICAL)
continue;
switch (clutter_input_device_get_device_type (dev))

View File

@ -360,9 +360,9 @@ on_device_added (ClutterSeat *seat,
}
static inline gboolean
device_is_slave_touchscreen (ClutterInputDevice *device)
device_is_physical_touchscreen (ClutterInputDevice *device)
{
return (clutter_input_device_get_device_mode (device) != CLUTTER_INPUT_MODE_MASTER &&
return (clutter_input_device_get_device_mode (device) != CLUTTER_INPUT_MODE_LOGICAL &&
clutter_input_device_get_device_type (device) == CLUTTER_TOUCHSCREEN_DEVICE);
}
@ -378,7 +378,7 @@ check_has_pointing_device (ClutterSeat *seat)
{
ClutterInputDevice *device = l->data;
if (clutter_input_device_get_device_mode (device) == CLUTTER_INPUT_MODE_MASTER)
if (clutter_input_device_get_device_mode (device) == CLUTTER_INPUT_MODE_LOGICAL)
continue;
if (clutter_input_device_get_device_type (device) == CLUTTER_TOUCHSCREEN_DEVICE ||
clutter_input_device_get_device_type (device) == CLUTTER_KEYBOARD_DEVICE)
@ -394,7 +394,7 @@ check_has_pointing_device (ClutterSeat *seat)
}
static inline gboolean
check_has_slave_touchscreen (ClutterSeat *seat)
check_has_physical_touchscreen (ClutterSeat *seat)
{
GList *l, *devices;
gboolean found = FALSE;
@ -405,7 +405,7 @@ check_has_slave_touchscreen (ClutterSeat *seat)
{
ClutterInputDevice *device = l->data;
if (clutter_input_device_get_device_mode (device) != CLUTTER_INPUT_MODE_MASTER &&
if (clutter_input_device_get_device_mode (device) != CLUTTER_INPUT_MODE_LOGICAL &&
clutter_input_device_get_device_type (device) == CLUTTER_TOUCHSCREEN_DEVICE)
{
found = TRUE;
@ -441,7 +441,7 @@ on_device_removed (ClutterSeat *seat,
g_clear_handle_id (&priv->device_update_idle_id, g_source_remove);
device_type = clutter_input_device_get_device_type (device);
has_touchscreen = check_has_slave_touchscreen (seat);
has_touchscreen = check_has_physical_touchscreen (seat);
if (device_type == CLUTTER_TOUCHSCREEN_DEVICE && has_touchscreen)
{
@ -491,7 +491,7 @@ set_initial_pointer_visibility (MetaBackend *backend,
{
ClutterInputDevice *device = l->data;
has_touchscreen |= device_is_slave_touchscreen (device);
has_touchscreen |= device_is_physical_touchscreen (device);
}
g_list_free (devices);
@ -1314,7 +1314,7 @@ meta_backend_update_last_device (MetaBackend *backend,
return;
if (!device ||
clutter_input_device_get_device_mode (device) == CLUTTER_INPUT_MODE_MASTER)
clutter_input_device_get_device_mode (device) == CLUTTER_INPUT_MODE_LOGICAL)
return;
priv->current_device = device;

View File

@ -138,7 +138,7 @@ meta_input_settings_get_devices (MetaInputSettings *settings,
ClutterInputDevice *device = l->data;
if (clutter_input_device_get_device_type (device) == type &&
clutter_input_device_get_device_mode (device) != CLUTTER_INPUT_MODE_MASTER)
clutter_input_device_get_device_mode (device) != CLUTTER_INPUT_MODE_LOGICAL)
list = g_slist_prepend (list, device);
}
@ -390,7 +390,7 @@ update_pointer_accel_profile (MetaInputSettings *input_settings,
device = l->data;
if (clutter_input_device_get_device_mode (device) ==
CLUTTER_INPUT_MODE_MASTER)
CLUTTER_INPUT_MODE_LOGICAL)
continue;
do_update_pointer_accel_profile (input_settings, settings,
@ -1880,7 +1880,7 @@ meta_input_settings_device_added (ClutterSeat *seat,
ClutterInputDevice *device,
MetaInputSettings *input_settings)
{
if (clutter_input_device_get_device_mode (device) == CLUTTER_INPUT_MODE_MASTER)
if (clutter_input_device_get_device_mode (device) == CLUTTER_INPUT_MODE_LOGICAL)
return;
evaluate_two_finger_scrolling (input_settings, device);
@ -1979,7 +1979,7 @@ check_mappable_devices (MetaInputSettings *input_settings)
{
ClutterInputDevice *device = l->data;
if (clutter_input_device_get_device_mode (device) == CLUTTER_INPUT_MODE_MASTER)
if (clutter_input_device_get_device_mode (device) == CLUTTER_INPUT_MODE_LOGICAL)
continue;
check_add_mappable_device (input_settings, device);

View File

@ -1348,7 +1348,7 @@ meta_input_device_native_new (MetaSeatNative *seat,
"id", device_id,
"name", libinput_device_get_name (libinput_device),
"device-type", type,
"device-mode", CLUTTER_INPUT_MODE_SLAVE,
"device-mode", CLUTTER_INPUT_MODE_PHYSICAL,
"enabled", TRUE,
"vendor-id", vendor,
"product-id", product,

View File

@ -1396,7 +1396,7 @@ evdev_add_device (MetaSeatNative *seat,
struct libinput_device *libinput_device)
{
ClutterInputDeviceType type;
ClutterInputDevice *device, *master = NULL;
ClutterInputDevice *device, *logical = NULL;
ClutterActor *stage;
device = meta_input_device_native_new (seat, libinput_device);
@ -1410,14 +1410,14 @@ evdev_add_device (MetaSeatNative *seat,
type = meta_input_device_native_determine_type (libinput_device);
if (type == CLUTTER_KEYBOARD_DEVICE)
master = seat->core_keyboard;
logical = seat->core_keyboard;
else if (type == CLUTTER_POINTER_DEVICE)
master = seat->core_pointer;
logical = seat->core_pointer;
if (master)
if (logical)
{
_clutter_input_device_set_associated_device (device, master);
_clutter_input_device_add_slave (master, device);
_clutter_input_device_set_associated_device (device, logical);
_clutter_input_device_add_physical_device (logical, device);
}
return device;
@ -2443,7 +2443,7 @@ meta_seat_native_constructed (GObject *object)
device = meta_input_device_native_new_virtual (
seat, CLUTTER_POINTER_DEVICE,
CLUTTER_INPUT_MODE_MASTER);
CLUTTER_INPUT_MODE_LOGICAL);
stage = meta_seat_native_get_stage (seat);
_clutter_input_device_set_stage (device, stage);
seat->pointer_x = INITIAL_POINTER_X;
@ -2455,7 +2455,7 @@ meta_seat_native_constructed (GObject *object)
device = meta_input_device_native_new_virtual (
seat, CLUTTER_KEYBOARD_DEVICE,
CLUTTER_INPUT_MODE_MASTER);
CLUTTER_INPUT_MODE_LOGICAL);
_clutter_input_device_set_stage (device, stage);
seat->core_keyboard = device;

View File

@ -696,7 +696,7 @@ meta_virtual_input_device_native_constructed (GObject *object)
virtual_evdev->device =
meta_input_device_native_new_virtual (virtual_evdev->seat,
device_type,
CLUTTER_INPUT_MODE_SLAVE);
CLUTTER_INPUT_MODE_PHYSICAL);
stage = meta_seat_native_get_stage (virtual_evdev->seat);
_clutter_input_device_set_stage (virtual_evdev->device, stage);

View File

@ -507,13 +507,13 @@ create_device (MetaSeatX11 *seat_x11,
{
case XIMasterKeyboard:
case XIMasterPointer:
mode = CLUTTER_INPUT_MODE_MASTER;
mode = CLUTTER_INPUT_MODE_LOGICAL;
is_enabled = TRUE;
break;
case XISlaveKeyboard:
case XISlavePointer:
mode = CLUTTER_INPUT_MODE_SLAVE;
mode = CLUTTER_INPUT_MODE_PHYSICAL;
is_enabled = FALSE;
break;
@ -671,12 +671,12 @@ add_device (MetaSeatX11 *seat_x11,
{
if (info->use == XISlavePointer || info->use == XISlaveKeyboard)
{
ClutterInputDevice *master;
ClutterInputDevice *logical;
master = g_hash_table_lookup (seat_x11->devices_by_id,
GINT_TO_POINTER (info->attachment));
_clutter_input_device_set_associated_device (device, master);
_clutter_input_device_add_slave (master, device);
logical = g_hash_table_lookup (seat_x11->devices_by_id,
GINT_TO_POINTER (info->attachment));
_clutter_input_device_set_associated_device (device, logical);
_clutter_input_device_add_physical_device (logical, device);
}
}
@ -746,9 +746,9 @@ meta_seat_x11_handle_device_event (ClutterSeat *seat,
}
static void
relate_masters (gpointer key,
gpointer value,
gpointer data)
relate_logical_devices (gpointer key,
gpointer value,
gpointer data)
{
MetaSeatX11 *seat_x11 = data;
ClutterInputDevice *device, *relative;
@ -761,18 +761,18 @@ relate_masters (gpointer key,
}
static void
relate_slaves (gpointer key,
gpointer value,
gpointer data)
relate_physical_devices (gpointer key,
gpointer value,
gpointer data)
{
MetaSeatX11 *seat_x11 = data;
ClutterInputDevice *master, *slave;
ClutterInputDevice *logical, *physical;
slave = g_hash_table_lookup (seat_x11->devices_by_id, key);
master = g_hash_table_lookup (seat_x11->devices_by_id, value);
physical = g_hash_table_lookup (seat_x11->devices_by_id, key);
logical = g_hash_table_lookup (seat_x11->devices_by_id, value);
_clutter_input_device_set_associated_device (slave, master);
_clutter_input_device_add_slave (master, slave);
_clutter_input_device_set_associated_device (physical, logical);
_clutter_input_device_add_physical_device (logical, physical);
}
static uint
@ -867,27 +867,27 @@ translate_hierarchy_event (ClutterBackend *backend,
else if ((ev->info[i].flags & XISlaveAttached) ||
(ev->info[i].flags & XISlaveDetached))
{
ClutterInputDevice *master, *slave;
ClutterInputDevice *logical, *physical;
XIDeviceInfo *info;
int n_devices;
g_debug ("Hierarchy event: slave %s",
g_debug ("Hierarchy event: physical device %s",
(ev->info[i].flags & XISlaveAttached)
? "attached"
: "detached");
slave = g_hash_table_lookup (seat_x11->devices_by_id,
GINT_TO_POINTER (ev->info[i].deviceid));
master = clutter_input_device_get_associated_device (slave);
physical = g_hash_table_lookup (seat_x11->devices_by_id,
GINT_TO_POINTER (ev->info[i].deviceid));
logical = clutter_input_device_get_associated_device (physical);
/* detach the slave in both cases */
if (master != NULL)
/* detach the physical device in both cases */
if (logical != NULL)
{
_clutter_input_device_remove_slave (master, slave);
_clutter_input_device_set_associated_device (slave, NULL);
_clutter_input_device_remove_physical_device (logical, physical);
_clutter_input_device_set_associated_device (physical, NULL);
}
/* and attach the slave to the new master if needed */
/* and attach the physical device to the new logical device if needed */
if (ev->info[i].flags & XISlaveAttached)
{
clutter_x11_trap_x_errors ();
@ -897,12 +897,12 @@ translate_hierarchy_event (ClutterBackend *backend,
clutter_x11_untrap_x_errors ();
if (info != NULL)
{
master = g_hash_table_lookup (seat_x11->devices_by_id,
GINT_TO_POINTER (info->attachment));
if (master != NULL)
logical = g_hash_table_lookup (seat_x11->devices_by_id,
GINT_TO_POINTER (info->attachment));
if (logical != NULL)
{
_clutter_input_device_set_associated_device (slave, master);
_clutter_input_device_add_slave (master, slave);
_clutter_input_device_set_associated_device (physical, logical);
_clutter_input_device_add_physical_device (logical, physical);
}
XIFreeDeviceInfo (info);
}
@ -1388,7 +1388,7 @@ meta_seat_x11_constructed (GObject *object)
{
MetaSeatX11 *seat_x11 = META_SEAT_X11 (object);
ClutterBackend *backend = clutter_get_default_backend ();
GHashTable *masters, *slaves;
GHashTable *logical_devices, *physical_devices;
XIDeviceInfo *info;
XIEventMask event_mask;
unsigned char mask[XIMaskLen(XI_LASTEVENT)] = { 0, };
@ -1396,8 +1396,8 @@ meta_seat_x11_constructed (GObject *object)
Display *xdisplay;
xdisplay = clutter_x11_get_default_display ();
masters = g_hash_table_new (NULL, NULL);
slaves = g_hash_table_new (NULL, NULL);
logical_devices = g_hash_table_new (NULL, NULL);
physical_devices = g_hash_table_new (NULL, NULL);
info = XIQueryDevice (clutter_x11_get_default_display (),
XIAllDevices, &n_devices);
@ -1414,14 +1414,14 @@ meta_seat_x11_constructed (GObject *object)
if (xi_device->use == XIMasterPointer ||
xi_device->use == XIMasterKeyboard)
{
g_hash_table_insert (masters,
g_hash_table_insert (logical_devices,
GINT_TO_POINTER (xi_device->deviceid),
GINT_TO_POINTER (xi_device->attachment));
}
else if (xi_device->use == XISlavePointer ||
xi_device->use == XISlaveKeyboard)
{
g_hash_table_insert (slaves,
g_hash_table_insert (physical_devices,
GINT_TO_POINTER (xi_device->deviceid),
GINT_TO_POINTER (xi_device->attachment));
}
@ -1429,11 +1429,11 @@ meta_seat_x11_constructed (GObject *object)
XIFreeDeviceInfo (info);
g_hash_table_foreach (masters, relate_masters, seat_x11);
g_hash_table_destroy (masters);
g_hash_table_foreach (logical_devices, relate_logical_devices, seat_x11);
g_hash_table_destroy (logical_devices);
g_hash_table_foreach (slaves, relate_slaves, seat_x11);
g_hash_table_destroy (slaves);
g_hash_table_foreach (physical_devices, relate_physical_devices, seat_x11);
g_hash_table_destroy (physical_devices);
XISetMask (mask, XI_HierarchyChanged);
XISetMask (mask, XI_DeviceChanged);
@ -1643,13 +1643,13 @@ meta_seat_x11_init (MetaSeatX11 *seat)
MetaSeatX11 *
meta_seat_x11_new (int opcode,
int master_pointer,
int master_keyboard)
int logical_pointer,
int logical_keyboard)
{
return g_object_new (META_TYPE_SEAT_X11,
"opcode", opcode,
"pointer-id", master_pointer,
"keyboard-id", master_keyboard,
"pointer-id", logical_pointer,
"keyboard-id", logical_keyboard,
NULL);
}
@ -1846,7 +1846,7 @@ meta_seat_x11_translate_event (MetaSeatX11 *seat,
GINT_TO_POINTER (xev->deviceid));
/* Set the stage for core events coming out of nowhere (see bug #684509) */
if (clutter_input_device_get_device_mode (device) == CLUTTER_INPUT_MODE_MASTER &&
if (clutter_input_device_get_device_mode (device) == CLUTTER_INPUT_MODE_LOGICAL &&
clutter_input_device_get_pointer_stage (device) == NULL &&
stage != NULL)
_clutter_input_device_set_stage (device, stage);
@ -2043,7 +2043,7 @@ meta_seat_x11_translate_event (MetaSeatX11 *seat,
}
/* Set the stage for core events coming out of nowhere (see bug #684509) */
if (clutter_input_device_get_device_mode (device) == CLUTTER_INPUT_MODE_MASTER &&
if (clutter_input_device_get_device_mode (device) == CLUTTER_INPUT_MODE_LOGICAL &&
clutter_input_device_get_pointer_stage (device) == NULL &&
stage != NULL)
_clutter_input_device_set_stage (device, stage);

View File

@ -27,8 +27,8 @@ G_BEGIN_DECLS
G_DECLARE_FINAL_TYPE (MetaSeatX11, meta_seat_x11, META, SEAT_X11, ClutterSeat)
MetaSeatX11 * meta_seat_x11_new (int opcode,
int master_pointer,
int master_keyboard);
int logical_pointer,
int logical_keyboard);
gboolean meta_seat_x11_translate_event (MetaSeatX11 *seat,
XEvent *xevent,
ClutterEvent *event);

View File

@ -119,11 +119,11 @@ lookup_device_capabilities (ClutterSeat *seat)
{
ClutterInputDeviceType device_type;
/* Only look for physical devices, master devices have rather generic
/* Only look for physical devices, logical devices have rather generic
* keyboard/pointer device types, which is not truly representative of
* the slave devices connected to them.
* the physical devices connected to them.
*/
if (clutter_input_device_get_device_mode (l->data) == CLUTTER_INPUT_MODE_MASTER)
if (clutter_input_device_get_device_mode (l->data) == CLUTTER_INPUT_MODE_LOGICAL)
continue;
device_type = clutter_input_device_get_device_type (l->data);
@ -291,7 +291,7 @@ event_is_synthesized_crossing (const ClutterEvent *event)
return FALSE;
device = clutter_event_get_source_device (event);
return clutter_input_device_get_device_mode (device) == CLUTTER_INPUT_MODE_MASTER;
return clutter_input_device_get_device_mode (device) == CLUTTER_INPUT_MODE_LOGICAL;
}
static gboolean
@ -311,7 +311,7 @@ event_from_supported_hardware_device (MetaWaylandSeat *seat,
input_mode = clutter_input_device_get_device_mode (input_device);
if (input_mode != CLUTTER_INPUT_MODE_SLAVE)
if (input_mode != CLUTTER_INPUT_MODE_PHYSICAL)
goto out;
hardware_device = TRUE;

View File

@ -45,7 +45,7 @@ is_tablet_device (ClutterInputDevice *device)
{
ClutterInputDeviceType device_type;
if (clutter_input_device_get_device_mode (device) == CLUTTER_INPUT_MODE_MASTER)
if (clutter_input_device_get_device_mode (device) == CLUTTER_INPUT_MODE_LOGICAL)
return FALSE;
device_type = clutter_input_device_get_device_type (device);

View File

@ -173,7 +173,7 @@ is_tablet_device (ClutterInputDevice *device)
{
ClutterInputDeviceType device_type;
if (clutter_input_device_get_device_mode (device) == CLUTTER_INPUT_MODE_MASTER)
if (clutter_input_device_get_device_mode (device) == CLUTTER_INPUT_MODE_LOGICAL)
return FALSE;
device_type = clutter_input_device_get_device_type (device);
@ -189,7 +189,7 @@ is_pad_device (ClutterInputDevice *device)
{
ClutterInputDeviceType device_type;
if (clutter_input_device_get_device_mode (device) == CLUTTER_INPUT_MODE_MASTER)
if (clutter_input_device_get_device_mode (device) == CLUTTER_INPUT_MODE_LOGICAL)
return FALSE;
device_type = clutter_input_device_get_device_type (device);