clutter: Drop ClutterInputDevice::enabled and setter/getter

This is unused now, and not something we generally allow.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
This commit is contained in:
Carlos Garnacho 2020-07-16 12:13:04 +02:00 committed by Marge Bot
parent c2940efe8b
commit b1d12a994d
6 changed files with 1 additions and 109 deletions

View File

@ -1460,23 +1460,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 (event->type != CLUTTER_DEVICE_ADDED &&
event->type != CLUTTER_DEVICE_REMOVED &&
!clutter_input_device_get_enabled (device))
return;
}
if (do_copy) if (do_copy)
{ {
ClutterEvent *copy; ClutterEvent *copy;

View File

@ -60,7 +60,6 @@ enum
PROP_DEVICE_MODE, PROP_DEVICE_MODE,
PROP_HAS_CURSOR, PROP_HAS_CURSOR,
PROP_ENABLED,
PROP_N_AXES, PROP_N_AXES,
@ -184,10 +183,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;
@ -256,10 +251,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;
@ -367,25 +358,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_LOGICAL 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:
* *
@ -710,56 +682,6 @@ clutter_input_device_get_device_type (ClutterInputDevice *device)
return device->device_type; return device->device_type;
} }
/**
* 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_PHYSICAL 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_LOGICAL)
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

View File

@ -98,11 +98,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);

View File

@ -1295,7 +1295,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_PHYSICAL, "device-mode", CLUTTER_INPUT_MODE_PHYSICAL,
"enabled", TRUE,
"vendor-id", vendor, "vendor-id", vendor,
"product-id", product, "product-id", product,
"n-rings", n_rings, "n-rings", n_rings,
@ -1355,7 +1354,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);

View File

@ -474,7 +474,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;
@ -520,19 +519,16 @@ create_device (MetaSeatX11 *seat_x11,
case XIMasterKeyboard: case XIMasterKeyboard:
case XIMasterPointer: case XIMasterPointer:
mode = CLUTTER_INPUT_MODE_LOGICAL; mode = CLUTTER_INPUT_MODE_LOGICAL;
is_enabled = TRUE;
break; break;
case XISlaveKeyboard: case XISlaveKeyboard:
case XISlavePointer: case XISlavePointer:
mode = CLUTTER_INPUT_MODE_PHYSICAL; mode = CLUTTER_INPUT_MODE_PHYSICAL;
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;
} }
@ -544,10 +540,7 @@ create_device (MetaSeatX11 *seat_x11,
} }
if (source == CLUTTER_PAD_DEVICE) if (source == CLUTTER_PAD_DEVICE)
{ get_pad_features (info, &num_rings, &num_strips);
is_enabled = TRUE;
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,
@ -556,7 +549,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,

View File

@ -171,8 +171,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",
@ -268,8 +266,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",