mirror of
https://codeberg.org/dwl/dwl-patches.git
synced 2025-10-26 17:54:17 +00:00
update chainkeys patch
This commit is contained in:
parent
b34818c2b4
commit
bdd3213b4b
@ -1,7 +1,7 @@
|
||||
From 8f2233d5e244f3a64c1169880b6b75ba562a8e1c Mon Sep 17 00:00:00 2001
|
||||
From 8cad102fd59463e8a2238845399dcaa1f759508c Mon Sep 17 00:00:00 2001
|
||||
From: Ben Collerson <benc@benc.cc>
|
||||
Date: Tue, 2 Jan 2024 10:33:59 +1000
|
||||
Subject: [PATCH] chainkeys
|
||||
Subject: [PATCH 1/2] chainkeys
|
||||
|
||||
---
|
||||
config.def.h | 62 ++++++++++++++++++++++++++--------------------------
|
||||
@ -9,7 +9,7 @@ Subject: [PATCH] chainkeys
|
||||
2 files changed, 52 insertions(+), 32 deletions(-)
|
||||
|
||||
diff --git a/config.def.h b/config.def.h
|
||||
index a8ed61d9..03a0ceeb 100644
|
||||
index 9009517..f4b7b2a 100644
|
||||
--- a/config.def.h
|
||||
+++ b/config.def.h
|
||||
@@ -105,10 +105,10 @@ static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TA
|
||||
@ -38,8 +38,8 @@ index a8ed61d9..03a0ceeb 100644
|
||||
- { MODKEY, XKB_KEY_k, focusstack, {.i = -1} },
|
||||
- { MODKEY, XKB_KEY_i, incnmaster, {.i = +1} },
|
||||
- { MODKEY, XKB_KEY_d, incnmaster, {.i = -1} },
|
||||
- { MODKEY, XKB_KEY_h, setmfact, {.f = -0.05} },
|
||||
- { MODKEY, XKB_KEY_l, setmfact, {.f = +0.05} },
|
||||
- { MODKEY, XKB_KEY_h, setmfact, {.f = -0.05f} },
|
||||
- { MODKEY, XKB_KEY_l, setmfact, {.f = +0.05f} },
|
||||
- { MODKEY, XKB_KEY_Return, zoom, {0} },
|
||||
- { MODKEY, XKB_KEY_Tab, view, {0} },
|
||||
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_C, killclient, {0} },
|
||||
@ -101,10 +101,10 @@ index a8ed61d9..03a0ceeb 100644
|
||||
CHVT(7), CHVT(8), CHVT(9), CHVT(10), CHVT(11), CHVT(12),
|
||||
};
|
||||
diff --git a/dwl.c b/dwl.c
|
||||
index 4d19357f..76d94de9 100644
|
||||
index f25ac2f..8ffad73 100644
|
||||
--- a/dwl.c
|
||||
+++ b/dwl.c
|
||||
@@ -138,6 +138,7 @@ typedef struct {
|
||||
@@ -139,6 +139,7 @@ typedef struct {
|
||||
|
||||
typedef struct {
|
||||
uint32_t mod;
|
||||
@ -112,7 +112,7 @@ index 4d19357f..76d94de9 100644
|
||||
xkb_keysym_t keysym;
|
||||
void (*func)(const Arg *);
|
||||
const Arg arg;
|
||||
@@ -337,6 +338,7 @@ static const char broken[] = "broken";
|
||||
@@ -338,6 +339,7 @@ static const char broken[] = "broken";
|
||||
static pid_t child_pid = -1;
|
||||
static int locked;
|
||||
static void *exclusive_focus;
|
||||
@ -120,7 +120,7 @@ index 4d19357f..76d94de9 100644
|
||||
static struct wl_display *dpy;
|
||||
static struct wlr_backend *backend;
|
||||
static struct wlr_scene *scene;
|
||||
@@ -1361,10 +1363,28 @@ keybinding(uint32_t mods, xkb_keysym_t sym)
|
||||
@@ -1363,10 +1365,28 @@ keybinding(uint32_t mods, xkb_keysym_t sym)
|
||||
const Key *k;
|
||||
for (k = keys; k < END(keys); k++) {
|
||||
if (CLEANMASK(mods) == CLEANMASK(k->mod)
|
||||
@ -153,3 +153,63 @@ index 4d19357f..76d94de9 100644
|
||||
--
|
||||
2.43.0
|
||||
|
||||
|
||||
From 0b11cce166dc0daabe305622d593532407a178ed Mon Sep 17 00:00:00 2001
|
||||
From: Ben Collerson <benc@benc.cc>
|
||||
Date: Tue, 2 Jan 2024 10:33:59 +1000
|
||||
Subject: [PATCH 2/2] fix types - signed ints should be signed.
|
||||
|
||||
---
|
||||
config.def.h | 4 ++--
|
||||
dwl.c | 6 +++---
|
||||
2 files changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/config.def.h b/config.def.h
|
||||
index f4b7b2a..ac70906 100644
|
||||
--- a/config.def.h
|
||||
+++ b/config.def.h
|
||||
@@ -126,8 +126,8 @@ static const Key keys[] = {
|
||||
{ MODKEY, -1, XKB_KEY_k, focusstack, {.i = -1} },
|
||||
{ MODKEY, -1, XKB_KEY_i, incnmaster, {.i = +1} },
|
||||
{ MODKEY, -1, XKB_KEY_d, incnmaster, {.i = -1} },
|
||||
- { MODKEY, -1, XKB_KEY_h, setmfact, {.f = -0.05} },
|
||||
- { MODKEY, -1, XKB_KEY_l, setmfact, {.f = +0.05} },
|
||||
+ { MODKEY, -1, XKB_KEY_h, setmfact, {.f = -0.05f} },
|
||||
+ { MODKEY, -1, XKB_KEY_l, setmfact, {.f = +0.05f} },
|
||||
{ MODKEY, -1, XKB_KEY_Return, zoom, {0} },
|
||||
{ MODKEY, -1, XKB_KEY_Tab, view, {0} },
|
||||
{ MODKEY|WLR_MODIFIER_SHIFT, -1, XKB_KEY_C, killclient, {0} },
|
||||
diff --git a/dwl.c b/dwl.c
|
||||
index 8ffad73..cbb9cbf 100644
|
||||
--- a/dwl.c
|
||||
+++ b/dwl.c
|
||||
@@ -139,7 +139,7 @@ typedef struct {
|
||||
|
||||
typedef struct {
|
||||
uint32_t mod;
|
||||
- xkb_keysym_t chain;
|
||||
+ int chain;
|
||||
xkb_keysym_t keysym;
|
||||
void (*func)(const Arg *);
|
||||
const Arg arg;
|
||||
@@ -339,7 +339,7 @@ static const char broken[] = "broken";
|
||||
static pid_t child_pid = -1;
|
||||
static int locked;
|
||||
static void *exclusive_focus;
|
||||
-static xkb_keysym_t chainkey = -1;
|
||||
+static int chainkey = -1;
|
||||
static struct wl_display *dpy;
|
||||
static struct wlr_backend *backend;
|
||||
static struct wlr_scene *scene;
|
||||
@@ -1381,7 +1381,7 @@ keybinding(uint32_t mods, xkb_keysym_t sym)
|
||||
return 1;
|
||||
}
|
||||
else if (CLEANMASK(mods) == CLEANMASK(k->mod)
|
||||
- && k->chain == sym
|
||||
+ && k->chain == (int)sym
|
||||
&& chainkey == -1
|
||||
&& k->func) {
|
||||
chainkey = sym;
|
||||
--
|
||||
2.43.0
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user