[gnome-settings-daemon] xrandr: Move GsdDeviceMapper handling to wacom plugin
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] xrandr: Move GsdDeviceMapper handling to wacom plugin
- Date: Tue, 18 Jul 2017 19:42:37 +0000 (UTC)
commit 41f1564340f8499eeb83131d3dcc6438037fad01
Author: Rui Matos <tiagomatos gmail com>
Date: Wed Apr 26 16:02:12 2017 +0200
xrandr: Move GsdDeviceMapper handling to wacom plugin
GsdDeviceMapper's only remaining role is to map wacom
tablets/touchscreens to outputs which logically belongs in the wacom
plugin and is already being done there for some device types so let's
move the other device type that was being handled here to that plugin
too.
https://bugzilla.gnome.org/show_bug.cgi?id=781907
plugins/wacom/gsd-wacom-manager.c | 3 ++
plugins/xrandr/gsd-xrandr-manager.c | 67 -----------------------------------
2 files changed, 3 insertions(+), 67 deletions(-)
---
diff --git a/plugins/wacom/gsd-wacom-manager.c b/plugins/wacom/gsd-wacom-manager.c
index 61d790d..3bcbca4 100644
--- a/plugins/wacom/gsd-wacom-manager.c
+++ b/plugins/wacom/gsd-wacom-manager.c
@@ -288,6 +288,9 @@ device_added_cb (GsdDeviceManager *device_manager,
(device_type & GSD_DEVICE_TYPE_TOUCHPAD) == 0) {
gsd_device_mapper_add_input (manager->priv->device_mapper,
gsd_device);
+ } else if ((device_type & GSD_DEVICE_TYPE_TOUCHSCREEN) != 0) {
+ gsd_device_mapper_add_input (manager->priv->device_mapper,
+ gsd_device);
}
}
diff --git a/plugins/xrandr/gsd-xrandr-manager.c b/plugins/xrandr/gsd-xrandr-manager.c
index c31976b..64cf0cf 100644
--- a/plugins/xrandr/gsd-xrandr-manager.c
+++ b/plugins/xrandr/gsd-xrandr-manager.c
@@ -45,10 +45,8 @@
#include <libgnome-desktop/gnome-pnp-ids.h>
#include "gsd-enums.h"
-#include "gsd-input-helper.h"
#include "gnome-settings-profile.h"
#include "gnome-settings-bus.h"
-#include "gsd-device-mapper.h"
#include "gsd-xrandr-manager.h"
#define GSD_XRANDR_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSD_TYPE_XRANDR_MANAGER,
GsdXrandrManagerPrivate))
@@ -103,11 +101,6 @@ struct GsdXrandrManagerPrivate {
GDBusConnection *connection;
GCancellable *bus_cancellable;
- GsdDeviceMapper *device_mapper;
- GsdDeviceManager *device_manager;
- guint device_added_id;
- guint device_removed_id;
-
/* fn-F7 status */
int current_fn_f7_config; /* -1 if no configs */
GnomeRRConfig **fn_f7_configs; /* NULL terminated, NULL if there are no configs */
@@ -1160,57 +1153,6 @@ get_allowed_rotations_for_output (GnomeRRConfig *config,
}
static void
-manager_device_added (GsdXrandrManager *manager,
- GsdDevice *device)
-{
- GsdDeviceType type;
-
- type = gsd_device_get_device_type (device);
-
- if ((type & GSD_DEVICE_TYPE_TOUCHSCREEN) == 0)
- return;
-
- gsd_device_mapper_add_input (manager->priv->device_mapper, device);
-}
-
-static void
-manager_device_removed (GsdXrandrManager *manager,
- GsdDevice *device)
-{
- GsdDeviceType type;
-
- type = gsd_device_get_device_type (device);
-
- if ((type & GSD_DEVICE_TYPE_TOUCHSCREEN) == 0)
- return;
-
- gsd_device_mapper_remove_input (manager->priv->device_mapper, device);
-}
-
-static void
-manager_init_devices (GsdXrandrManager *manager)
-{
- GList *devices, *d;
-
- manager->priv->device_mapper = gsd_device_mapper_get ();
- manager->priv->device_manager = gsd_device_manager_get ();
- manager->priv->device_added_id =
- g_signal_connect_swapped (manager->priv->device_manager, "device-added",
- G_CALLBACK (manager_device_added), manager);
- manager->priv->device_removed_id =
- g_signal_connect_swapped (manager->priv->device_manager, "device-removed",
- G_CALLBACK (manager_device_removed), manager);
-
- devices = gsd_device_manager_list_devices (manager->priv->device_manager,
- GSD_DEVICE_TYPE_TOUCHSCREEN);
-
- for (d = devices; d; d = d->next)
- manager_device_added (manager, d->data);
-
- g_list_free (devices);
-}
-
-static void
on_rr_screen_acquired (GObject *object,
GAsyncResult *result,
gpointer user_data)
@@ -1236,7 +1178,6 @@ on_rr_screen_acquired (GObject *object,
manager->priv->running = TRUE;
manager->priv->settings = g_settings_new (CONF_SCHEMA);
- manager_init_devices (manager);
register_manager_dbus (manager);
log_close ();
@@ -1304,14 +1245,6 @@ gsd_xrandr_manager_stop (GsdXrandrManager *manager)
manager->priv->connection = NULL;
}
- if (manager->priv->device_manager != NULL) {
- g_signal_handler_disconnect (manager->priv->device_manager,
- manager->priv->device_added_id);
- g_signal_handler_disconnect (manager->priv->device_manager,
- manager->priv->device_removed_id);
- manager->priv->device_manager = NULL;
- }
-
free_fn_f7_configs (manager);
log_open ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]