x11: Drop subscription for input event from floating devices

This is unlikely to happen, and unlikely to be right (eg. we don't translate
input event coordinates, since those are not in display coordinate space, we
don't offer any feedback for those either).

This can simply be dropped, we listen to XIAllMasterDevices, which suffices
for what we want to do.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/852
This commit is contained in:
Carlos Garnacho 2019-09-25 14:52:00 +02:00
parent a382698acc
commit 88fb003cdc
3 changed files with 0 additions and 49 deletions

View File

@ -756,7 +756,6 @@ translate_hierarchy_event (ClutterBackend *backend,
ClutterInputDevice *master, *slave;
XIDeviceInfo *info;
int n_devices;
gboolean send_changed = FALSE;
g_debug ("Hierarchy event: slave %s",
(ev->info[i].flags & XISlaveAttached)
@ -772,8 +771,6 @@ translate_hierarchy_event (ClutterBackend *backend,
{
_clutter_input_device_remove_slave (master, slave);
_clutter_input_device_set_associated_device (slave, NULL);
send_changed = TRUE;
}
/* and attach the slave to the new master if needed */
@ -792,23 +789,10 @@ translate_hierarchy_event (ClutterBackend *backend,
{
_clutter_input_device_set_associated_device (slave, master);
_clutter_input_device_add_slave (master, slave);
send_changed = TRUE;
}
XIFreeDeviceInfo (info);
}
}
if (send_changed)
{
ClutterStage *stage = _clutter_input_device_get_stage (master);
if (stage != NULL)
{
meta_stage_x11_events_device_changed (META_STAGE_X11 (_clutter_stage_get_window (stage)),
master,
CLUTTER_DEVICE_MANAGER (manager_xi2));
}
}
}
}
}

View File

@ -291,31 +291,6 @@ meta_stage_x11_unrealize (ClutterStageWindow *stage_window)
g_clear_pointer (&stage_x11->onscreen, cogl_object_unref);
}
void
meta_stage_x11_events_device_changed (MetaStageX11 *stage_x11,
ClutterInputDevice *device,
ClutterDeviceManager *device_manager)
{
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_x11);
if (clutter_input_device_get_device_mode (device) == CLUTTER_INPUT_MODE_FLOATING)
_clutter_device_manager_select_stage_events (device_manager,
stage_cogl->wrapper);
}
static void
stage_events_device_added (ClutterDeviceManager *device_manager,
ClutterInputDevice *device,
gpointer user_data)
{
ClutterStageWindow *stage_window = user_data;
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
if (clutter_input_device_get_device_mode (device) == CLUTTER_INPUT_MODE_FLOATING)
_clutter_device_manager_select_stage_events (device_manager,
stage_cogl->wrapper);
}
static void
frame_cb (CoglOnscreen *onscreen,
CoglFrameEvent frame_event,
@ -416,10 +391,6 @@ meta_stage_x11_realize (ClutterStageWindow *stage_window)
{
_clutter_device_manager_select_stage_events (device_manager,
stage_cogl->wrapper);
g_signal_connect (device_manager, "device-added",
G_CALLBACK (stage_events_device_added),
stage_window);
}
meta_stage_x11_fix_window_size (stage_x11,

View File

@ -80,10 +80,6 @@ struct _MetaStageX11Class
CLUTTER_EXPORT
GType meta_stage_x11_get_type (void) G_GNUC_CONST;
void meta_stage_x11_events_device_changed (MetaStageX11 *stage_x11,
ClutterInputDevice *device,
ClutterDeviceManager *device_manager);
/* Private to subclasses */
void meta_stage_x11_set_user_time (MetaStageX11 *stage_x11,
guint32 user_time);