snail: rebase onto 0.7

This commit is contained in:
45mg 2024-07-19 10:16:32 +00:00 committed by Dima Krasner
parent e7752b138a
commit b8a5bf5142

View File

@ -1,4 +1,4 @@
From 75423c5e2614f31d95729e25159ed9162f95a667 Mon Sep 17 00:00:00 2001
From 39b6da6082db641191699be906e485f8c8fbc4e6 Mon Sep 17 00:00:00 2001
From: Dima Krasner <dima@dimakrasner.com>
Date: Sun, 11 Feb 2024 09:09:16 +0200
Subject: [PATCH] add the snail layout
@ -97,10 +97,10 @@ With 2 windows in the master area, many windows in the stack and low mfact:
2 files changed, 105 insertions(+), 1 deletion(-)
diff --git a/config.def.h b/config.def.h
index a784eb4..e29af77 100644
index 22d2171..abf9644 100644
--- a/config.def.h
+++ b/config.def.h
@@ -33,6 +33,7 @@ static const Layout layouts[] = {
@@ -34,6 +34,7 @@ static const Layout layouts[] = {
{ "[]=", tile },
{ "><>", NULL }, /* no layout function means floating behavior */
{ "[M]", monocle },
@ -108,7 +108,7 @@ index a784eb4..e29af77 100644
};
/* monitors */
@@ -45,7 +46,7 @@ static const MonitorRule monrules[] = {
@@ -48,7 +49,7 @@ static const MonitorRule monrules[] = {
{ "eDP-1", 0.5f, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 },
*/
/* defaults */
@ -117,7 +117,7 @@ index a784eb4..e29af77 100644
};
/* keyboard */
@@ -136,6 +137,7 @@ static const Key keys[] = {
@@ -139,6 +140,7 @@ static const Key keys[] = {
{ MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} },
{ MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} },
{ MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} },
@ -126,10 +126,10 @@ index a784eb4..e29af77 100644
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} },
{ MODKEY, XKB_KEY_e, togglefullscreen, {0} },
diff --git a/dwl.c b/dwl.c
index d48bf40..5dcd64c 100644
index 5bf995e..45ac5ad 100644
--- a/dwl.c
+++ b/dwl.c
@@ -331,6 +331,7 @@ static void setmon(Client *c, Monitor *m, uint32_t newtags);
@@ -333,6 +333,7 @@ static void setmon(Client *c, Monitor *m, uint32_t newtags);
static void setpsel(struct wl_listener *listener, void *data);
static void setsel(struct wl_listener *listener, void *data);
static void setup(void);
@ -137,7 +137,7 @@ index d48bf40..5dcd64c 100644
static void spawn(const Arg *arg);
static void startdrag(struct wl_listener *listener, void *data);
static void tag(const Arg *arg);
@@ -2581,6 +2582,107 @@ setup(void)
@@ -2644,6 +2645,107 @@ setup(void)
#endif
}
@ -156,7 +156,7 @@ index d48bf40..5dcd64c 100644
+ return;
+
+ if (n > m->nmaster)
+ mw = m->nmaster ? ROUND(m->w.width * m->mfact) : 0;
+ mw = m->nmaster ? (int)round(m->w.width * m->mfact) : 0;
+
+ wl_list_for_each(c, &clients, link) {
+ if (!VISIBLEON(c, m) || c->isfloating || c->isfullscreen)
@ -246,5 +246,5 @@ index d48bf40..5dcd64c 100644
spawn(const Arg *arg)
{
--
2.43.0
2.45.2