[PATCH] [xorg/xserver] config: handle device change event properly

Erkki Seppälä erkki.seppala at vincit.fi
Fri Mar 18 07:35:36 PDT 2011


wakeup_handler in udev.c wasn't dealing with udev change events.
There are situations when a device can gain its input capabilities
after it has been added to the system and therefore the change events
must be handled as well.

The change is handled as a consecutive device removal and addition.

Signed-off-by: Erkki Seppälä <erkki.seppala at vincit.fi>
Signed-off-by: Stefan Kost <Stefan.Kost at nokia.com>
---

Stefan, please ask a proper Reported-by tag for the bug from the
original reporter.

 config/udev.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/config/udev.c b/config/udev.c
index a2f5710..c120747 100644
--- a/config/udev.c
+++ b/config/udev.c
@@ -246,6 +246,10 @@ wakeup_handler(pointer data, int err, pointer read_mask)
                 device_added(udev_device);
             else if (!strcmp(action, "remove"))
                 device_removed(udev_device);
+            else if (!strcmp(action, "change")) {
+                device_removed(udev_device);
+                device_added(udev_device);
+            }
         }
         udev_device_unref(udev_device);
     }
-- 
1.7.0.4



More information about the xorg-devel mailing list