teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone

Blame 0327-terminal-parse-ID_SEAT-not-only-for-parents-but-the-.patch

Zbigniew Jędrzejewski-Szmek 62fe94
From 3e7f6cf9565e007545112f245e69b2bf45866258 Mon Sep 17 00:00:00 2001
Zbigniew Jędrzejewski-Szmek 62fe94
From: David Herrmann <dh.herrmann@gmail.com>
Zbigniew Jędrzejewski-Szmek 62fe94
Date: Sat, 20 Sep 2014 09:29:11 +0200
Zbigniew Jędrzejewski-Szmek 62fe94
Subject: [PATCH] terminal: parse ID_SEAT not only for parents but the device
Zbigniew Jędrzejewski-Szmek 62fe94
 itself
Zbigniew Jędrzejewski-Szmek 62fe94
Zbigniew Jędrzejewski-Szmek 62fe94
When deciding what seat a device is on, we have to traverse all parents
Zbigniew Jędrzejewski-Szmek 62fe94
to find one with an ID_SEAT tag, otherwise, input devices plugged on a
Zbigniew Jędrzejewski-Szmek 62fe94
seated USB-hub are not automatically attached to the right seat. But any
Zbigniew Jędrzejewski-Szmek 62fe94
tags on the main device still overwrite the tags of the childs, so fix our
Zbigniew Jędrzejewski-Szmek 62fe94
logic to check the device itself first, before traversing the parents.
Zbigniew Jędrzejewski-Szmek 62fe94
---
Zbigniew Jędrzejewski-Szmek 62fe94
 src/libsystemd-terminal/sysview.c | 4 ++--
Zbigniew Jędrzejewski-Szmek 62fe94
 1 file changed, 2 insertions(+), 2 deletions(-)
Zbigniew Jędrzejewski-Szmek 62fe94
Zbigniew Jędrzejewski-Szmek 62fe94
diff --git a/src/libsystemd-terminal/sysview.c b/src/libsystemd-terminal/sysview.c
Zbigniew Jędrzejewski-Szmek 62fe94
index fde87d1117..6c1a9543b9 100644
Zbigniew Jędrzejewski-Szmek 62fe94
--- a/src/libsystemd-terminal/sysview.c
Zbigniew Jędrzejewski-Szmek 62fe94
+++ b/src/libsystemd-terminal/sysview.c
Zbigniew Jędrzejewski-Szmek 62fe94
@@ -893,11 +893,11 @@ static int context_ud_hotplug(sysview_context *c, struct udev_device *d) {
Zbigniew Jędrzejewski-Szmek 62fe94
 
Zbigniew Jędrzejewski-Szmek 62fe94
                 p = d;
Zbigniew Jędrzejewski-Szmek 62fe94
                 seatname = NULL;
Zbigniew Jędrzejewski-Szmek 62fe94
-                while ((p = udev_device_get_parent(p))) {
Zbigniew Jędrzejewski-Szmek 62fe94
+                do {
Zbigniew Jędrzejewski-Szmek 62fe94
                         seatname = udev_device_get_property_value(p, "ID_SEAT");
Zbigniew Jędrzejewski-Szmek 62fe94
                         if (seatname)
Zbigniew Jędrzejewski-Szmek 62fe94
                                 break;
Zbigniew Jędrzejewski-Szmek 62fe94
-                }
Zbigniew Jędrzejewski-Szmek 62fe94
+                } while ((p = udev_device_get_parent(p)));
Zbigniew Jędrzejewski-Szmek 62fe94
 
Zbigniew Jędrzejewski-Szmek 62fe94
                 seat = sysview_find_seat(c, seatname ? : "seat0");
Zbigniew Jędrzejewski-Szmek 62fe94
                 if (!seat)