From d1c05312af9d63ef874b6eab5ef7122610ec0f1f Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Mon, 12 Jan 2009 20:17:48 +0000 Subject: Update to xserver 1.5.3 + latests commits on server-1.5-branch. tested by stsp@, david@, form@, ckuethe@, oga@. thanks. --- xserver/config/hal.c | 27 +++++++++++++++++++++++++++ xserver/config/x11-input.fdi | 4 ++-- 2 files changed, 29 insertions(+), 2 deletions(-) (limited to 'xserver/config') diff --git a/xserver/config/hal.c b/xserver/config/hal.c index 0e0505b66..639e0ec2b 100644 --- a/xserver/config/hal.c +++ b/xserver/config/hal.c @@ -166,6 +166,26 @@ get_prop_string_array(LibHalContext *hal_ctx, const char *udi, const char *prop) return ret; } +static BOOL +device_is_duplicate(char *config_info) +{ + DeviceIntPtr dev; + + for (dev = inputInfo.devices; dev; dev = dev->next) + { + if (dev->config_info && (strcmp(dev->config_info, config_info) == 0)) + return TRUE; + } + + for (dev = inputInfo.off_devices; dev; dev = dev->next) + { + if (dev->config_info && (strcmp(dev->config_info, config_info) == 0)) + return TRUE; + } + + return FALSE; +} + static void device_added(LibHalContext *hal_ctx, const char *udi) { @@ -227,6 +247,13 @@ device_added(LibHalContext *hal_ctx, const char *udi) } sprintf(config_info, "hal:%s", udi); + /* Check for duplicate devices */ + if (device_is_duplicate(config_info)) + { + LogMessage(X_WARNING, "config/hal: device %s already added. Ignoring.\n", name); + goto unwind; + } + /* ok, grab options from hal.. iterate through all properties * and lets see if any of them are options that we can add */ set = libhal_device_get_all_properties(hal_ctx, udi, &error); diff --git a/xserver/config/x11-input.fdi b/xserver/config/x11-input.fdi index f2e2d50ab..6c4a1e325 100644 --- a/xserver/config/x11-input.fdi +++ b/xserver/config/x11-input.fdi @@ -64,8 +64,8 @@ base - keyboard + kbd otherwise). --> + kbd pc105 -- cgit v1.2.3