From d8cd256f4258c0d724314f1bb4e95f04b3a5a4bd Mon Sep 17 00:00:00 2001 From: Raheman Vaiya Date: Thu, 22 Sep 2022 03:35:08 -0400 Subject: [PATCH] reload: Avoid managing the vkbd --- src/daemon.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/daemon.c b/src/daemon.c index 9b2e9d4..8989b35 100644 --- a/src/daemon.c +++ b/src/daemon.c @@ -175,10 +175,14 @@ static int lookup_config_ent(uint32_t id, struct config_ent **match) static void manage_device(struct device *dev) { + int match; uint32_t id = dev->vendor_id << 16 | dev->product_id; struct config_ent *ent = NULL; - int match = lookup_config_ent(id, &ent); + if (!strcmp(dev->name, VKBD_NAME)) + return; + + match = lookup_config_ent(id, &ent); if ((match && dev->capabilities & CAP_KEYBOARD) || (match == 2 && dev->capabilities & (CAP_MOUSE | CAP_MOUSE_ABS))) { @@ -449,8 +453,7 @@ static int event_handler(struct event *ev) break; case EV_DEV_ADD: - if (strcmp(ev->dev->name, VKBD_NAME)) - manage_device(ev->dev); + manage_device(ev->dev); break; case EV_DEV_REMOVE: printf("DEVICE: \033[31;1mremoved\033[0m\t%04hx:%04hx %s\n",