[mutter/wip/carlosg/clutter-seat: 136/159] x11: Drop subscription for input event from floating devices
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/clutter-seat: 136/159] x11: Drop subscription for input event from floating devices
- Date: Thu, 7 Nov 2019 19:49:02 +0000 (UTC)
commit 25cf61789ba1b32a621d4661c0f699e85c57c20c
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed Sep 25 14:52:00 2019 +0200
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
src/backends/x11/meta-device-manager-x11.c | 16 ----------------
src/backends/x11/meta-stage-x11.c | 29 -----------------------------
src/backends/x11/meta-stage-x11.h | 4 ----
3 files changed, 49 deletions(-)
---
diff --git a/src/backends/x11/meta-device-manager-x11.c b/src/backends/x11/meta-device-manager-x11.c
index c2a0ec112..db1fadc3e 100644
--- a/src/backends/x11/meta-device-manager-x11.c
+++ b/src/backends/x11/meta-device-manager-x11.c
@@ -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));
- }
- }
}
}
}
diff --git a/src/backends/x11/meta-stage-x11.c b/src/backends/x11/meta-stage-x11.c
index 0f39bf990..0b211a716 100644
--- a/src/backends/x11/meta-stage-x11.c
+++ b/src/backends/x11/meta-stage-x11.c
@@ -305,31 +305,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,
@@ -430,10 +405,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,
diff --git a/src/backends/x11/meta-stage-x11.h b/src/backends/x11/meta-stage-x11.h
index ca838e0b7..0ec429e53 100644
--- a/src/backends/x11/meta-stage-x11.h
+++ b/src/backends/x11/meta-stage-x11.h
@@ -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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]