[mutter/wip/carlosg/there-can-be-only-one: 18/23] backends/x11: Drop handling of XI_DeviceChange




commit 568881735b1a85336e680c19105a917b58781299
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Jan 13 14:06:30 2022 +0100

    backends/x11: Drop handling of XI_DeviceChange
    
    Even though it's great that XI2 has an event to notify about device
    changes, this is something we can let the MetaBackend code handle
    consistently for all backends, since looking for the source device
    works everywhere.

 src/backends/x11/meta-backend-x11.c | 29 +----------------------------
 1 file changed, 1 insertion(+), 28 deletions(-)
---
diff --git a/src/backends/x11/meta-backend-x11.c b/src/backends/x11/meta-backend-x11.c
index d2bbab45e7..263d7d4689 100644
--- a/src/backends/x11/meta-backend-x11.c
+++ b/src/backends/x11/meta-backend-x11.c
@@ -249,30 +249,6 @@ translate_crossing_event (MetaBackendX11 *x11,
   meta_backend_x11_translate_crossing_event (x11, enter_event);
 }
 
-static void
-handle_device_change (MetaBackendX11 *x11,
-                      XIEvent        *event)
-{
-  XIDeviceChangedEvent *device_changed;
-  ClutterInputDevice *device;
-  ClutterBackend *backend;
-  ClutterSeat *seat;
-
-  if (event->evtype != XI_DeviceChanged)
-    return;
-
-  device_changed = (XIDeviceChangedEvent *) event;
-
-  if (device_changed->reason != XISlaveSwitch)
-    return;
-
-  backend = meta_backend_get_clutter_backend (META_BACKEND (x11));
-  seat = clutter_backend_get_default_seat (backend);
-  device = meta_seat_x11_lookup_device_id (META_SEAT_X11 (seat),
-                                           device_changed->sourceid);
-  meta_backend_update_last_device (META_BACKEND (x11), device);
-}
-
 /* Clutter makes the assumption that there is only one X window
  * per stage, which is a valid assumption to make for a generic
  * application toolkit. As such, it will ignore any events sent
@@ -321,10 +297,7 @@ handle_input_event (MetaBackendX11 *x11,
     {
       XIEvent *input_event = (XIEvent *) event->xcookie.data;
 
-      if (input_event->evtype == XI_DeviceChanged)
-        handle_device_change (x11, input_event);
-      else
-        maybe_spoof_event_as_stage_event (x11, input_event);
+      maybe_spoof_event_as_stage_event (x11, input_event);
     }
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]