[gnome-settings-daemon] common: Map Dell touchscreen to the correct output
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] common: Map Dell touchscreen to the correct output
- Date: Fri, 16 May 2014 13:15:02 +0000 (UTC)
commit 25bf2dcb022c1df3aec62eb0e4a48c35f79f56d3
Author: Bastien Nocera <hadess hadess net>
Date: Fri May 16 12:15:43 2014 +0200
common: Map Dell touchscreen to the correct output
Map the "3M 3M MicroTouch USB controller" touchscreen to the Dell S2340T
output.
https://bugzilla.gnome.org/show_bug.cgi?id=730247
plugins/common/gsd-device-mapper.c | 24 +++++++++++++++++++++++-
1 files changed, 23 insertions(+), 1 deletions(-)
---
diff --git a/plugins/common/gsd-device-mapper.c b/plugins/common/gsd-device-mapper.c
index ee4e8c5..8fdad66 100644
--- a/plugins/common/gsd-device-mapper.c
+++ b/plugins/common/gsd-device-mapper.c
@@ -325,6 +325,13 @@ mapping_helper_add (MappingHelper *helper,
g_array_insert_val (helper->device_maps, pos, info);
}
+struct {
+ const gchar *input_device_name;
+ const gchar *edid[3];
+} hardcoded_devices[] = {
+ { "3M 3M MicroTouch USB controller", { "DEL", "DELL S2340T", NULL } }
+};
+
/* This function gets a map of outputs, sorted by confidence, for a given device,
* the array can actually contain NULLs if no output matched a priority. */
static void
@@ -334,8 +341,24 @@ input_info_guess_candidates (GsdInputInfo *input,
gboolean found = FALSE;
const gchar *name;
gchar **split;
+ gint i;
name = gdk_device_get_name (input->device);
+
+ /* Hard-coded detection */
+ for (i = 0; i < G_N_ELEMENTS (hardcoded_devices); i++) {
+ if (g_strcmp0 (name, hardcoded_devices[i].input_device_name) != 0)
+ continue;
+
+ outputs[GSD_PRIO_EDID_MATCH_FULL] = find_output_by_edid (input->mapper->rr_screen,
hardcoded_devices[i].edid);
+ if (outputs[GSD_PRIO_EDID_MATCH_FULL]) {
+ found = TRUE;
+ break;
+ }
+ }
+ if (found)
+ return;
+
split = g_strsplit (name, " ", -1);
/* On Wacom devices that are integrated on a not-in-system screen (eg. Cintiqs),
@@ -351,7 +374,6 @@ input_info_guess_candidates (GsdInputInfo *input,
{ "WAC", split[1], NULL },
{ "WAC", NULL, NULL }
};
- gint i;
for (i = 0; i < G_N_ELEMENTS (edids); i++) {
/* i + 1 matches the desired priority, we skip GSD_PRIO_BUILTIN here */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]