diff options
author | David Herrmann <dh.herrmann@gmail.com> | 2014-09-20 09:29:11 +0200 |
---|---|---|
committer | David Herrmann <dh.herrmann@gmail.com> | 2014-09-20 11:46:49 +0200 |
commit | 3e7f6cf9565e007545112f245e69b2bf45866258 (patch) | |
tree | 722ee47b5326ff9c50083166606a1bed56bd8db3 /src/libsystemd-terminal/sysview.c | |
parent | c00524c9cc7fb498c7244350e25823b8352f078c (diff) |
terminal: parse ID_SEAT not only for parents but the device itself
When deciding what seat a device is on, we have to traverse all parents
to find one with an ID_SEAT tag, otherwise, input devices plugged on a
seated USB-hub are not automatically attached to the right seat. But any
tags on the main device still overwrite the tags of the childs, so fix our
logic to check the device itself first, before traversing the parents.
Diffstat (limited to 'src/libsystemd-terminal/sysview.c')
-rw-r--r-- | src/libsystemd-terminal/sysview.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsystemd-terminal/sysview.c b/src/libsystemd-terminal/sysview.c index fde87d1117..6c1a9543b9 100644 --- a/src/libsystemd-terminal/sysview.c +++ b/src/libsystemd-terminal/sysview.c @@ -893,11 +893,11 @@ static int context_ud_hotplug(sysview_context *c, struct udev_device *d) { p = d; seatname = NULL; - while ((p = udev_device_get_parent(p))) { + do { seatname = udev_device_get_property_value(p, "ID_SEAT"); if (seatname) break; - } + } while ((p = udev_device_get_parent(p))); seat = sysview_find_seat(c, seatname ? : "seat0"); if (!seat) |