mirror of
https://codeberg.org/dwl/dwl-patches.git
synced 2025-10-27 10:14:16 +00:00
Update swallow patch
This commit is contained in:
parent
77b45273bf
commit
4f98041841
@ -10,8 +10,8 @@ line by avoiding cluttering the screen with many unusable terminals.
|
|||||||
|
|
||||||
`foot` is the terminal by default, you can change it in client rules in config.h.
|
`foot` is the terminal by default, you can change it in client rules in config.h.
|
||||||
|
|
||||||
In `2025-03-03 v0.7` version, the patch had been rewritten from scratch to make
|
In `2025-03-03 v0.7` version and above, the patch had been rewritten from
|
||||||
it more robust and add a few more features:
|
scratch to make it more robust and add a few more features:
|
||||||
|
|
||||||
- "dynamically swallow" windows by pressing `Alt+a` (a focused window will
|
- "dynamically swallow" windows by pressing `Alt+a` (a focused window will
|
||||||
swallow/unswallow the previously focused one)
|
swallow/unswallow the previously focused one)
|
||||||
@ -22,8 +22,8 @@ it more robust and add a few more features:
|
|||||||
|
|
||||||
#### swallow.patch
|
#### swallow.patch
|
||||||
|
|
||||||
- [git branch](https://codeberg.org/nikitaivanov/dwl/src/branch/swallow)
|
- [v0.7](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/swallow/swallow.patch)
|
||||||
- [2025-03-03 v0.7](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/swallow/swallow.patch) (added "dynamic swallowing support")
|
- [2025-03-03 v0.7](https://codeberg.org/dwl/dwl-patches/raw/commit/2e5748edfe1129f95c7bb1bf9dd590a897f55f57/patches/swallow/swallow.patch) (added "dynamic swallowing" support)
|
||||||
- [2024-07-13](https://codeberg.org/dwl/dwl-patches/raw/commit/f1ed83eaeba46108f4ee8164094cb431d64a3e68/patches/swallow/swallow.patch)
|
- [2024-07-13](https://codeberg.org/dwl/dwl-patches/raw/commit/f1ed83eaeba46108f4ee8164094cb431d64a3e68/patches/swallow/swallow.patch)
|
||||||
- [2024-07-13](https://codeberg.org/dwl/dwl-patches/raw/commit/f64d701bab2f9f52d3637edd091684f920407d87/patches/swallow/swallow.patch)
|
- [2024-07-13](https://codeberg.org/dwl/dwl-patches/raw/commit/f64d701bab2f9f52d3637edd091684f920407d87/patches/swallow/swallow.patch)
|
||||||
- [2024-05-02](https://codeberg.org/dwl/dwl-patches/raw/commit/9c5d5d85f3ac780e7a14d5d0535e3349ce8b8f53/patches/swallow/swallow.patch)
|
- [2024-05-02](https://codeberg.org/dwl/dwl-patches/raw/commit/9c5d5d85f3ac780e7a14d5d0535e3349ce8b8f53/patches/swallow/swallow.patch)
|
||||||
@ -39,7 +39,8 @@ it more robust and add a few more features:
|
|||||||
|
|
||||||
Apply this patch on top of the swallow.patch if you use FreeBSD.
|
Apply this patch on top of the swallow.patch if you use FreeBSD.
|
||||||
|
|
||||||
- [2025-03-03 v0.7](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/swallow/swallow-freebsd.patch)
|
- [v0.7](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/swallow/swallow-freebsd.patch)
|
||||||
|
- [2025-03-03 v0.7](https://codeberg.org/dwl/dwl-patches/raw/commit/2e5748edfe1129f95c7bb1bf9dd590a897f55f57/patches/swallow/swallow-freebsd.patch) (added "dynamic swallowing" support)
|
||||||
- [2024-07-13](https://codeberg.org/dwl/dwl-patches/raw/commit/f1ed83eaeba46108f4ee8164094cb431d64a3e68/patches/swallow/swallow-freebsd.patch)
|
- [2024-07-13](https://codeberg.org/dwl/dwl-patches/raw/commit/f1ed83eaeba46108f4ee8164094cb431d64a3e68/patches/swallow/swallow-freebsd.patch)
|
||||||
|
|
||||||
### Authors
|
### Authors
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
From 002e11e197cd254f06b65681ffd5bcf617d830b9 Mon Sep 17 00:00:00 2001
|
From 301e1b368d92a32a7bdcd4bd1f0ede0295977e3e Mon Sep 17 00:00:00 2001
|
||||||
From: Nikita Ivanov <nikita.vyach.ivanov@gmail.com>
|
From: Nikita Ivanov <nikita.vyach.ivanov@gmail.com>
|
||||||
Date: Mon, 3 Mar 2025 19:49:07 +0100
|
Date: Mon, 3 Mar 2025 19:49:07 +0100
|
||||||
Subject: [PATCH] swallow: add FreeBSD support
|
Subject: [PATCH] swallow: add FreeBSD support
|
||||||
@ -8,7 +8,7 @@ Subject: [PATCH] swallow: add FreeBSD support
|
|||||||
1 file changed, 17 insertions(+)
|
1 file changed, 17 insertions(+)
|
||||||
|
|
||||||
diff --git a/dwl.c b/dwl.c
|
diff --git a/dwl.c b/dwl.c
|
||||||
index bbbbe6f..dc55319 100644
|
index 71d500a..52fdd9c 100644
|
||||||
--- a/dwl.c
|
--- a/dwl.c
|
||||||
+++ b/dwl.c
|
+++ b/dwl.c
|
||||||
@@ -67,6 +67,14 @@
|
@@ -67,6 +67,14 @@
|
||||||
@ -50,5 +50,5 @@ index bbbbe6f..dc55319 100644
|
|||||||
|
|
||||||
void
|
void
|
||||||
--
|
--
|
||||||
2.48.1
|
2.49.0
|
||||||
|
|
||||||
|
|||||||
@ -1,13 +1,13 @@
|
|||||||
From 7255d7e2e1b87c0583a202ea20c83fa75466c0fc Mon Sep 17 00:00:00 2001
|
From a220e1ed4b04a66c837dfc8e3363d3e696cbf541 Mon Sep 17 00:00:00 2001
|
||||||
From: Nikita Ivanov <nikita.vyach.ivanov@gmail.com>
|
From: Nikita Ivanov <nikita.vyach.ivanov@gmail.com>
|
||||||
Date: Wed, 5 Feb 2025 02:34:39 +0100
|
Date: Wed, 5 Feb 2025 02:34:39 +0100
|
||||||
Subject: [PATCH] Swallow: hide the terminal when it spawns a client
|
Subject: [PATCH] Swallow: hide the terminal when it spawns a client
|
||||||
|
|
||||||
---
|
---
|
||||||
client.h | 12 ++++
|
client.h | 12 ++++
|
||||||
config.def.h | 10 +++-
|
config.def.h | 11 +++-
|
||||||
dwl.c | 152 +++++++++++++++++++++++++++++++++++++++++++++++++--
|
dwl.c | 152 +++++++++++++++++++++++++++++++++++++++++++++++++--
|
||||||
3 files changed, 167 insertions(+), 7 deletions(-)
|
3 files changed, 168 insertions(+), 7 deletions(-)
|
||||||
|
|
||||||
diff --git a/client.h b/client.h
|
diff --git a/client.h b/client.h
|
||||||
index 42f225f..bc9cad2 100644
|
index 42f225f..bc9cad2 100644
|
||||||
@ -33,18 +33,19 @@ index 42f225f..bc9cad2 100644
|
|||||||
client_get_clip(Client *c, struct wlr_box *clip)
|
client_get_clip(Client *c, struct wlr_box *clip)
|
||||||
{
|
{
|
||||||
diff --git a/config.def.h b/config.def.h
|
diff --git a/config.def.h b/config.def.h
|
||||||
index 22d2171..fb5f8fb 100644
|
index 22d2171..42342f1 100644
|
||||||
--- a/config.def.h
|
--- a/config.def.h
|
||||||
+++ b/config.def.h
|
+++ b/config.def.h
|
||||||
@@ -13,6 +13,7 @@ static const float focuscolor[] = COLOR(0x005577ff);
|
@@ -13,6 +13,8 @@ static const float focuscolor[] = COLOR(0x005577ff);
|
||||||
static const float urgentcolor[] = COLOR(0xff0000ff);
|
static const float urgentcolor[] = COLOR(0xff0000ff);
|
||||||
/* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
|
/* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
|
||||||
static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You can also use glsl colors */
|
static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You can also use glsl colors */
|
||||||
+static int enableautoswallow = 1; /* enables autoswallowing newly spawned clients */
|
+static int enableautoswallow = 1; /* enables autoswallowing newly spawned clients */
|
||||||
|
+static float swallowborder = 1.0f; /* add this multiplied by borderpx to border when a client is swallowed */
|
||||||
|
|
||||||
/* tagging - TAGCOUNT must be no greater than 31 */
|
/* tagging - TAGCOUNT must be no greater than 31 */
|
||||||
#define TAGCOUNT (9)
|
#define TAGCOUNT (9)
|
||||||
@@ -22,10 +23,11 @@ static int log_level = WLR_ERROR;
|
@@ -22,10 +24,11 @@ static int log_level = WLR_ERROR;
|
||||||
|
|
||||||
/* NOTE: ALWAYS keep a rule declared even if you don't use rules (e.g leave at least one example) */
|
/* NOTE: ALWAYS keep a rule declared even if you don't use rules (e.g leave at least one example) */
|
||||||
static const Rule rules[] = {
|
static const Rule rules[] = {
|
||||||
@ -59,7 +60,7 @@ index 22d2171..fb5f8fb 100644
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* layout(s) */
|
/* layout(s) */
|
||||||
@@ -142,6 +144,8 @@ static const Key keys[] = {
|
@@ -142,6 +145,8 @@ static const Key keys[] = {
|
||||||
{ MODKEY, XKB_KEY_space, setlayout, {0} },
|
{ MODKEY, XKB_KEY_space, setlayout, {0} },
|
||||||
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} },
|
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} },
|
||||||
{ MODKEY, XKB_KEY_e, togglefullscreen, {0} },
|
{ MODKEY, XKB_KEY_e, togglefullscreen, {0} },
|
||||||
@ -69,7 +70,7 @@ index 22d2171..fb5f8fb 100644
|
|||||||
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, tag, {.ui = ~0} },
|
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, tag, {.ui = ~0} },
|
||||||
{ MODKEY, XKB_KEY_comma, focusmon, {.i = WLR_DIRECTION_LEFT} },
|
{ MODKEY, XKB_KEY_comma, focusmon, {.i = WLR_DIRECTION_LEFT} },
|
||||||
diff --git a/dwl.c b/dwl.c
|
diff --git a/dwl.c b/dwl.c
|
||||||
index def2562..bbbbe6f 100644
|
index def2562..71d500a 100644
|
||||||
--- a/dwl.c
|
--- a/dwl.c
|
||||||
+++ b/dwl.c
|
+++ b/dwl.c
|
||||||
@@ -73,12 +73,13 @@
|
@@ -73,12 +73,13 @@
|
||||||
@ -83,7 +84,7 @@ index def2562..bbbbe6f 100644
|
|||||||
#define TAGMASK ((1u << TAGCOUNT) - 1)
|
#define TAGMASK ((1u << TAGCOUNT) - 1)
|
||||||
#define LISTEN(E, L, H) wl_signal_add((E), ((L)->notify = (H), (L)))
|
#define LISTEN(E, L, H) wl_signal_add((E), ((L)->notify = (H), (L)))
|
||||||
#define LISTEN_STATIC(E, H) do { static struct wl_listener _l = {.notify = (H)}; wl_signal_add((E), &_l); } while (0)
|
#define LISTEN_STATIC(E, H) do { static struct wl_listener _l = {.notify = (H)}; wl_signal_add((E), &_l); } while (0)
|
||||||
+#define BORDERPX(C) (borderpx + ((C)->swallowing ? (C)->swallowing->bw : 0))
|
+#define BORDERPX(C) (borderpx + ((C)->swallowing ? (int)ceilf(swallowborder * (C)->swallowing->bw) : 0))
|
||||||
|
|
||||||
/* enums */
|
/* enums */
|
||||||
enum { CurNormal, CurPressed, CurMove, CurResize }; /* cursor */
|
enum { CurNormal, CurPressed, CurMove, CurResize }; /* cursor */
|
||||||
@ -346,5 +347,5 @@ index def2562..bbbbe6f 100644
|
|||||||
if (c == exclusive_focus) {
|
if (c == exclusive_focus) {
|
||||||
exclusive_focus = NULL;
|
exclusive_focus = NULL;
|
||||||
--
|
--
|
||||||
2.48.1
|
2.49.0
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user