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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -119,11 +119,11 @@ lookup_device_capabilities (ClutterSeat *seat)
{ {
ClutterInputDeviceType device_type; 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 * 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; continue;
device_type = clutter_input_device_get_device_type (l->data); device_type = clutter_input_device_get_device_type (l->data);
@ -291,7 +291,7 @@ event_is_synthesized_crossing (const ClutterEvent *event)
return FALSE; return FALSE;
device = clutter_event_get_source_device (event); 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 static gboolean
@ -311,7 +311,7 @@ event_from_supported_hardware_device (MetaWaylandSeat *seat,
input_mode = clutter_input_device_get_device_mode (input_device); 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; goto out;
hardware_device = TRUE; hardware_device = TRUE;

View File

@ -45,7 +45,7 @@ is_tablet_device (ClutterInputDevice *device)
{ {
ClutterInputDeviceType device_type; 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; return FALSE;
device_type = clutter_input_device_get_device_type (device); device_type = clutter_input_device_get_device_type (device);

View File

@ -173,7 +173,7 @@ is_tablet_device (ClutterInputDevice *device)
{ {
ClutterInputDeviceType device_type; 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; return FALSE;
device_type = clutter_input_device_get_device_type (device); device_type = clutter_input_device_get_device_type (device);
@ -189,7 +189,7 @@ is_pad_device (ClutterInputDevice *device)
{ {
ClutterInputDeviceType device_type; 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; return FALSE;
device_type = clutter_input_device_get_device_type (device); device_type = clutter_input_device_get_device_type (device);