[mutter/wip/carlosg/drop-device-idle-monitors] backends: Drop per-device idle monitors



commit 04977f7e8d386d3b62ca5ed25acfc253f32167a1
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Feb 5 16:22:49 2020 +0100

    backends: Drop per-device idle monitors
    
    We preserve the core one, which represents the union of all input
    devices. It might make sense to make this per-seat in the future,
    but certainly the per-device granularity is unused (at last!) and
    useless.
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/1039

 src/backends/meta-idle-monitor-dbus.c | 47 -----------------------------------
 1 file changed, 47 deletions(-)
---
diff --git a/src/backends/meta-idle-monitor-dbus.c b/src/backends/meta-idle-monitor-dbus.c
index f7433068e..3fa0018bd 100644
--- a/src/backends/meta-idle-monitor-dbus.c
+++ b/src/backends/meta-idle-monitor-dbus.c
@@ -209,38 +209,6 @@ create_monitor_skeleton (GDBusObjectManagerServer *manager,
   g_object_unref (object);
 }
 
-static void
-on_device_added (ClutterSeat              *seat,
-                 ClutterInputDevice       *device,
-                 GDBusObjectManagerServer *manager)
-{
-
-  MetaIdleMonitor *monitor;
-  int device_id;
-  char *path;
-
-  device_id = clutter_input_device_get_device_id (device);
-  monitor = meta_idle_monitor_get_for_device (device);
-  path = g_strdup_printf ("/org/gnome/Mutter/IdleMonitor/Device%d", device_id);
-
-  create_monitor_skeleton (manager, monitor, path);
-  g_free (path);
-}
-
-static void
-on_device_removed (ClutterSeat              *seat,
-                   ClutterInputDevice       *device,
-                   GDBusObjectManagerServer *manager)
-{
-  int device_id;
-  char *path;
-
-  device_id = clutter_input_device_get_device_id (device);
-  path = g_strdup_printf ("/org/gnome/Mutter/IdleMonitor/Device%d", device_id);
-  g_dbus_object_manager_server_unexport (manager, path);
-  g_free (path);
-}
-
 static void
 on_bus_acquired (GDBusConnection *connection,
                  const char      *name,
@@ -248,8 +216,6 @@ on_bus_acquired (GDBusConnection *connection,
 {
   GDBusObjectManagerServer *manager;
   MetaIdleMonitor *monitor;
-  ClutterSeat *seat;
-  GList *devices, *iter;
   char *path;
 
   manager = g_dbus_object_manager_server_new ("/org/gnome/Mutter/IdleMonitor");
@@ -261,19 +227,6 @@ on_bus_acquired (GDBusConnection *connection,
   create_monitor_skeleton (manager, monitor, path);
   g_free (path);
 
-  seat = clutter_backend_get_default_seat (clutter_get_default_backend ());
-  devices = clutter_seat_list_devices (seat);
-
-  for (iter = devices; iter; iter = iter->next)
-    on_device_added (seat, iter->data, manager);
-
-  g_list_free (devices);
-
-  g_signal_connect_object (seat, "device-added",
-                           G_CALLBACK (on_device_added), manager, 0);
-  g_signal_connect_object (seat, "device-removed",
-                           G_CALLBACK (on_device_removed), manager, 0);
-
   g_dbus_object_manager_server_set_connection (manager, connection);
 }
 


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