mirror of
https://github.com/brl/mutter.git
synced 2024-11-10 07:56:14 -05:00
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
This commit is contained in:
parent
5c704e3f81
commit
586723eb44
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user