mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 01:20:42 -05:00
clutter: Drop ClutterInputDevice::enabled and setter/getter
This is unused now, and not something we generally allow. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403
This commit is contained in:
parent
575a4ca281
commit
579220a762
@ -1549,21 +1549,12 @@ _clutter_event_push (const ClutterEvent *event,
|
|||||||
gboolean do_copy)
|
gboolean do_copy)
|
||||||
{
|
{
|
||||||
ClutterMainContext *context = _clutter_context_get_default ();
|
ClutterMainContext *context = _clutter_context_get_default ();
|
||||||
ClutterInputDevice *device;
|
|
||||||
|
|
||||||
g_assert (context != NULL);
|
g_assert (context != NULL);
|
||||||
|
|
||||||
if (context->events_queue == NULL)
|
if (context->events_queue == NULL)
|
||||||
context->events_queue = g_queue_new ();
|
context->events_queue = g_queue_new ();
|
||||||
|
|
||||||
/* disabled devices don't propagate events */
|
|
||||||
device = clutter_event_get_device (event);
|
|
||||||
if (device != NULL)
|
|
||||||
{
|
|
||||||
if (!clutter_input_device_get_enabled (device))
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (do_copy)
|
if (do_copy)
|
||||||
{
|
{
|
||||||
ClutterEvent *copy;
|
ClutterEvent *copy;
|
||||||
|
@ -61,7 +61,6 @@ enum
|
|||||||
PROP_DEVICE_MODE,
|
PROP_DEVICE_MODE,
|
||||||
|
|
||||||
PROP_HAS_CURSOR,
|
PROP_HAS_CURSOR,
|
||||||
PROP_ENABLED,
|
|
||||||
|
|
||||||
PROP_N_AXES,
|
PROP_N_AXES,
|
||||||
|
|
||||||
@ -189,10 +188,6 @@ clutter_input_device_set_property (GObject *gobject,
|
|||||||
self->has_cursor = g_value_get_boolean (value);
|
self->has_cursor = g_value_get_boolean (value);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PROP_ENABLED:
|
|
||||||
clutter_input_device_set_enabled (self, g_value_get_boolean (value));
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PROP_VENDOR_ID:
|
case PROP_VENDOR_ID:
|
||||||
self->vendor_id = g_value_dup_string (value);
|
self->vendor_id = g_value_dup_string (value);
|
||||||
break;
|
break;
|
||||||
@ -265,10 +260,6 @@ clutter_input_device_get_property (GObject *gobject,
|
|||||||
g_value_set_uint (value, clutter_input_device_get_n_axes (self));
|
g_value_set_uint (value, clutter_input_device_get_n_axes (self));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PROP_ENABLED:
|
|
||||||
g_value_set_boolean (value, self->is_enabled);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PROP_VENDOR_ID:
|
case PROP_VENDOR_ID:
|
||||||
g_value_set_string (value, self->vendor_id);
|
g_value_set_string (value, self->vendor_id);
|
||||||
break;
|
break;
|
||||||
@ -392,25 +383,6 @@ clutter_input_device_class_init (ClutterInputDeviceClass *klass)
|
|||||||
FALSE,
|
FALSE,
|
||||||
CLUTTER_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
|
CLUTTER_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterInputDevice:enabled:
|
|
||||||
*
|
|
||||||
* Whether the device is enabled.
|
|
||||||
*
|
|
||||||
* A device with the #ClutterInputDevice:device-mode property set
|
|
||||||
* to %CLUTTER_INPUT_MODE_MASTER cannot be disabled.
|
|
||||||
*
|
|
||||||
* A device must be enabled in order to receive events from it.
|
|
||||||
*
|
|
||||||
* Since: 1.6
|
|
||||||
*/
|
|
||||||
obj_props[PROP_ENABLED] =
|
|
||||||
g_param_spec_boolean ("enabled",
|
|
||||||
P_("Enabled"),
|
|
||||||
P_("Whether the device is enabled"),
|
|
||||||
FALSE,
|
|
||||||
CLUTTER_PARAM_READWRITE);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ClutterInputDevice:n-axes:
|
* ClutterInputDevice:n-axes:
|
||||||
*
|
*
|
||||||
@ -765,56 +737,6 @@ clutter_input_device_get_device_id (ClutterInputDevice *device)
|
|||||||
return device->id;
|
return device->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_input_device_set_enabled:
|
|
||||||
* @device: a #ClutterInputDevice
|
|
||||||
* @enabled: %TRUE to enable the @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
|
|
||||||
* be disabled.
|
|
||||||
*
|
|
||||||
* Since: 1.6
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_input_device_set_enabled (ClutterInputDevice *device,
|
|
||||||
gboolean enabled)
|
|
||||||
{
|
|
||||||
g_return_if_fail (CLUTTER_IS_INPUT_DEVICE (device));
|
|
||||||
|
|
||||||
enabled = !!enabled;
|
|
||||||
|
|
||||||
if (!enabled && device->device_mode == CLUTTER_INPUT_MODE_MASTER)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (device->is_enabled == enabled)
|
|
||||||
return;
|
|
||||||
|
|
||||||
device->is_enabled = enabled;
|
|
||||||
|
|
||||||
g_object_notify_by_pspec (G_OBJECT (device), obj_props[PROP_ENABLED]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_input_device_get_enabled:
|
|
||||||
* @device: a #ClutterInputDevice
|
|
||||||
*
|
|
||||||
* Retrieves whether @device is enabled.
|
|
||||||
*
|
|
||||||
* Return value: %TRUE if the device is enabled
|
|
||||||
*
|
|
||||||
* Since: 1.6
|
|
||||||
*/
|
|
||||||
gboolean
|
|
||||||
clutter_input_device_get_enabled (ClutterInputDevice *device)
|
|
||||||
{
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), FALSE);
|
|
||||||
|
|
||||||
return device->is_enabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clutter_input_device_get_coords:
|
* clutter_input_device_get_coords:
|
||||||
* @device: a #ClutterInputDevice
|
* @device: a #ClutterInputDevice
|
||||||
|
@ -100,11 +100,6 @@ CLUTTER_EXPORT
|
|||||||
ClutterInputMode clutter_input_device_get_device_mode (ClutterInputDevice *device);
|
ClutterInputMode clutter_input_device_get_device_mode (ClutterInputDevice *device);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
gboolean clutter_input_device_get_has_cursor (ClutterInputDevice *device);
|
gboolean clutter_input_device_get_has_cursor (ClutterInputDevice *device);
|
||||||
CLUTTER_EXPORT
|
|
||||||
void clutter_input_device_set_enabled (ClutterInputDevice *device,
|
|
||||||
gboolean enabled);
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
gboolean clutter_input_device_get_enabled (ClutterInputDevice *device);
|
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
guint clutter_input_device_get_n_axes (ClutterInputDevice *device);
|
guint clutter_input_device_get_n_axes (ClutterInputDevice *device);
|
||||||
|
@ -1304,7 +1304,6 @@ meta_input_device_native_new (MetaSeatNative *seat,
|
|||||||
"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_SLAVE,
|
||||||
"enabled", TRUE,
|
|
||||||
"vendor-id", vendor,
|
"vendor-id", vendor,
|
||||||
"product-id", product,
|
"product-id", product,
|
||||||
"n-rings", n_rings,
|
"n-rings", n_rings,
|
||||||
@ -1367,7 +1366,6 @@ meta_input_device_native_new_virtual (MetaSeatNative *seat,
|
|||||||
"name", name,
|
"name", name,
|
||||||
"device-type", type,
|
"device-type", type,
|
||||||
"device-mode", mode,
|
"device-mode", mode,
|
||||||
"enabled", TRUE,
|
|
||||||
"seat", seat,
|
"seat", seat,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
@ -473,7 +473,6 @@ create_device (MetaSeatX11 *seat_x11,
|
|||||||
ClutterInputDeviceType source, touch_source;
|
ClutterInputDeviceType source, touch_source;
|
||||||
ClutterInputDevice *retval;
|
ClutterInputDevice *retval;
|
||||||
ClutterInputMode mode;
|
ClutterInputMode mode;
|
||||||
gboolean is_enabled;
|
|
||||||
uint32_t num_touches = 0, num_rings = 0, num_strips = 0;
|
uint32_t num_touches = 0, num_rings = 0, num_strips = 0;
|
||||||
char *vendor_id = NULL, *product_id = NULL, *node_path = NULL;
|
char *vendor_id = NULL, *product_id = NULL, *node_path = NULL;
|
||||||
|
|
||||||
@ -519,19 +518,16 @@ create_device (MetaSeatX11 *seat_x11,
|
|||||||
case XIMasterKeyboard:
|
case XIMasterKeyboard:
|
||||||
case XIMasterPointer:
|
case XIMasterPointer:
|
||||||
mode = CLUTTER_INPUT_MODE_MASTER;
|
mode = CLUTTER_INPUT_MODE_MASTER;
|
||||||
is_enabled = TRUE;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case XISlaveKeyboard:
|
case XISlaveKeyboard:
|
||||||
case XISlavePointer:
|
case XISlavePointer:
|
||||||
mode = CLUTTER_INPUT_MODE_SLAVE;
|
mode = CLUTTER_INPUT_MODE_SLAVE;
|
||||||
is_enabled = FALSE;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case XIFloatingSlave:
|
case XIFloatingSlave:
|
||||||
default:
|
default:
|
||||||
mode = CLUTTER_INPUT_MODE_FLOATING;
|
mode = CLUTTER_INPUT_MODE_FLOATING;
|
||||||
is_enabled = FALSE;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -543,10 +539,7 @@ create_device (MetaSeatX11 *seat_x11,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (source == CLUTTER_PAD_DEVICE)
|
if (source == CLUTTER_PAD_DEVICE)
|
||||||
{
|
|
||||||
is_enabled = TRUE;
|
|
||||||
get_pad_features (info, &num_rings, &num_strips);
|
get_pad_features (info, &num_rings, &num_strips);
|
||||||
}
|
|
||||||
|
|
||||||
retval = g_object_new (META_TYPE_INPUT_DEVICE_X11,
|
retval = g_object_new (META_TYPE_INPUT_DEVICE_X11,
|
||||||
"name", info->name,
|
"name", info->name,
|
||||||
@ -555,7 +548,6 @@ create_device (MetaSeatX11 *seat_x11,
|
|||||||
"device-type", source,
|
"device-type", source,
|
||||||
"device-mode", mode,
|
"device-mode", mode,
|
||||||
"backend", backend,
|
"backend", backend,
|
||||||
"enabled", is_enabled,
|
|
||||||
"vendor-id", vendor_id,
|
"vendor-id", vendor_id,
|
||||||
"product-id", product_id,
|
"product-id", product_id,
|
||||||
"device-node", node_path,
|
"device-node", node_path,
|
||||||
|
@ -173,8 +173,6 @@ seat_device_added_cb (ClutterSeat *seat,
|
|||||||
g_print ("*** enabling device '%s' ***\n",
|
g_print ("*** enabling device '%s' ***\n",
|
||||||
clutter_input_device_get_device_name (device));
|
clutter_input_device_get_device_name (device));
|
||||||
|
|
||||||
clutter_input_device_set_enabled (device, TRUE);
|
|
||||||
|
|
||||||
hand = clutter_test_utils_create_texture_from_file (TESTS_DATADIR
|
hand = clutter_test_utils_create_texture_from_file (TESTS_DATADIR
|
||||||
G_DIR_SEPARATOR_S
|
G_DIR_SEPARATOR_S
|
||||||
"redhand.png",
|
"redhand.png",
|
||||||
@ -272,8 +270,6 @@ test_devices_main (int argc, char **argv)
|
|||||||
g_print ("*** enabling device '%s' ***\n",
|
g_print ("*** enabling device '%s' ***\n",
|
||||||
clutter_input_device_get_device_name (device));
|
clutter_input_device_get_device_name (device));
|
||||||
|
|
||||||
clutter_input_device_set_enabled (device, TRUE);
|
|
||||||
|
|
||||||
hand = clutter_test_utils_create_texture_from_file (TESTS_DATADIR
|
hand = clutter_test_utils_create_texture_from_file (TESTS_DATADIR
|
||||||
G_DIR_SEPARATOR_S
|
G_DIR_SEPARATOR_S
|
||||||
"redhand.png",
|
"redhand.png",
|
||||||
|
Loading…
Reference in New Issue
Block a user