fix ungroup-keyboards patch

This commit is contained in:
Ben Collerson 2024-06-16 14:38:36 +10:00
parent 5492f432a9
commit 6381929534

View File

@ -1,4 +1,4 @@
From 511055bbce063f722c2db2d8b56dbe7f132f3319 Mon Sep 17 00:00:00 2001
From d9b9797680ae58bdb910e3bc1f71408f6b67c0d5 Mon Sep 17 00:00:00 2001
From: Ben Collerson <benc@benc.cc>
Date: Sat, 15 Jun 2024 12:34:01 +1000
Subject: [PATCH] ungroup-keyboards
@ -7,8 +7,8 @@ Ungroup keyboards based on device name. My use case is keeping the
ydotool virtual keyboard from from being grouped with other keyboards.
---
config.def.h | 7 +++++++
dwl.c | 28 +++++++++++++++++++++++++++-
2 files changed, 34 insertions(+), 1 deletion(-)
dwl.c | 29 ++++++++++++++++++++++++++++-
2 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/config.def.h b/config.def.h
index a784eb4f..9ad1c256 100644
@ -29,7 +29,7 @@ index a784eb4f..9ad1c256 100644
static const int repeat_delay = 600;
diff --git a/dwl.c b/dwl.c
index 5a31aeef..227b33bf 100644
index 5a31aeef..41db830b 100644
--- a/dwl.c
+++ b/dwl.c
@@ -141,6 +141,11 @@ typedef struct {
@ -73,7 +73,7 @@ index 5a31aeef..227b33bf 100644
void
cursorconstrain(struct wlr_pointer_constraint_v1 *constraint)
{
@@ -1464,10 +1484,16 @@ inputdevice(struct wl_listener *listener, void *data)
@@ -1464,10 +1484,17 @@ inputdevice(struct wl_listener *listener, void *data)
* available. */
struct wlr_input_device *device = data;
uint32_t caps;
@ -85,6 +85,7 @@ index 5a31aeef..227b33bf 100644
+ for (r = kbinputrules; r < END(kbinputrules); r++) {
+ if (!r->name || strstr(device->name, r->name)) {
+ r->kbcreate(wlr_keyboard_from_input_device(device));
+ break;
+ }
+ }
+