update bottomstack for HEAD

This commit is contained in:
wochap 2024-04-11 17:56:11 -05:00
parent 5368aa392c
commit 0f4e40fee4
No known key found for this signature in database
GPG Key ID: FE4CF844E73095E1

View File

@ -1,7 +1,7 @@
From e0774958da4e9dc72fd3b0e7de7732e8c0c52449 Mon Sep 17 00:00:00 2001 From 589c964e47965d84ffd3a2b036e75feddd619eed Mon Sep 17 00:00:00 2001
From: wochap <gean.marroquin@gmail.com> From: wochap <gean.marroquin@gmail.com>
Date: Wed, 22 Nov 2023 19:02:09 -0500 Date: Thu, 11 Apr 2024 16:50:20 -0500
Subject: [PATCH 1/2] [PATCH 1/2] apply main...Abanoub8:bottomstack.patch Subject: [PATCH] add bstack and bstackhoriz layouts
--- ---
config.def.h | 4 +++ config.def.h | 4 +++
@ -9,7 +9,7 @@ Subject: [PATCH 1/2] [PATCH 1/2] apply main...Abanoub8:bottomstack.patch
2 files changed, 88 insertions(+) 2 files changed, 88 insertions(+)
diff --git a/config.def.h b/config.def.h diff --git a/config.def.h b/config.def.h
index db0babc..0be86bc 100644 index 8847e58..68b62db 100644
--- a/config.def.h --- a/config.def.h
+++ b/config.def.h +++ b/config.def.h
@@ -33,6 +33,8 @@ static const Layout layouts[] = { @@ -33,6 +33,8 @@ static const Layout layouts[] = {
@ -21,7 +21,7 @@ index db0babc..0be86bc 100644
}; };
/* monitors */ /* monitors */
@@ -132,6 +134,8 @@ static const Key keys[] = { @@ -134,6 +136,8 @@ static const Key keys[] = {
{ MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} }, { MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} },
{ MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} }, { MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} },
{ MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} }, { MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} },
@ -31,18 +31,18 @@ index db0babc..0be86bc 100644
{ 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} },
diff --git a/dwl.c b/dwl.c diff --git a/dwl.c b/dwl.c
index ef27a1d..49209dc 100644 index bf763df..dc3d000 100644
--- a/dwl.c --- a/dwl.c
+++ b/dwl.c +++ b/dwl.c
@@ -51,6 +51,7 @@ @@ -55,6 +55,7 @@
#include <wlr/types/wlr_xdg_decoration_v1.h> #include <wlr/types/wlr_xdg_decoration_v1.h>
#include <wlr/types/wlr_xdg_output_v1.h> #include <wlr/types/wlr_xdg_output_v1.h>
#include <wlr/types/wlr_xdg_shell.h> #include <wlr/types/wlr_xdg_shell.h>
+#include <wlr/util/box.h> +#include <wlr/util/box.h>
#include <wlr/util/log.h> #include <wlr/util/log.h>
#include <wlr/util/region.h>
#include <xkbcommon/xkbcommon.h> #include <xkbcommon/xkbcommon.h>
#ifdef XWAYLAND @@ -347,6 +348,8 @@ static Monitor *xytomon(double x, double y);
@@ -327,6 +328,8 @@ static Monitor *xytomon(double x, double y);
static void xytonode(double x, double y, struct wlr_surface **psurface, static void xytonode(double x, double y, struct wlr_surface **psurface,
Client **pc, LayerSurface **pl, double *nx, double *ny); Client **pc, LayerSurface **pl, double *nx, double *ny);
static void zoom(const Arg *arg); static void zoom(const Arg *arg);
@ -51,7 +51,7 @@ index ef27a1d..49209dc 100644
/* variables */ /* variables */
static const char broken[] = "broken"; static const char broken[] = "broken";
@@ -2902,3 +2905,84 @@ main(int argc, char *argv[]) @@ -3088,3 +3091,84 @@ main(int argc, char *argv[])
usage: usage:
die("Usage: %s [-v] [-d] [-s startup command]", argv[0]); die("Usage: %s [-v] [-d] [-s startup command]", argv[0]);
} }
@ -60,7 +60,7 @@ index ef27a1d..49209dc 100644
+bstack(Monitor *m) +bstack(Monitor *m)
+{ +{
+ int w, h, mh, mx, tx, ty, tw; + int w, h, mh, mx, tx, ty, tw;
+ unsigned int i, n = 0; + int i, n = 0;
+ Client *c; + Client *c;
+ +
+ wl_list_for_each(c, &clients, link) + wl_list_for_each(c, &clients, link)
@ -70,7 +70,7 @@ index ef27a1d..49209dc 100644
+ return; + return;
+ +
+ if (n > m->nmaster) { + if (n > m->nmaster) {
+ mh = m->nmaster ? m->mfact * m->w.height : 0; + mh = ROUND(m->nmaster ? m->mfact * m->w.height : 0);
+ tw = m->w.width / (n - m->nmaster); + tw = m->w.width / (n - m->nmaster);
+ ty = m->w.y + mh; + ty = m->w.y + mh;
+ } else { + } else {
@ -86,11 +86,11 @@ index ef27a1d..49209dc 100644
+ continue; + continue;
+ if (i < m->nmaster) { + if (i < m->nmaster) {
+ w = (m->w.width - mx) / (MIN(n, m->nmaster) - i); + w = (m->w.width - mx) / (MIN(n, m->nmaster) - i);
+ resize(c, (struct wlr_box) { .x = m->w.x + mx, .y = m->w.y, .width = w - (2 * c->bw), .height = mh - (2 * c->bw) }, 0); + resize(c, (struct wlr_box) { .x = m->w.x + mx, .y = m->w.y, .width = w, .height = mh }, 0);
+ mx += c->geom.width; + mx += c->geom.width;
+ } else { + } else {
+ h = m->w.height - mh; + h = m->w.height - mh;
+ resize(c, (struct wlr_box) { .x = tx, .y = ty, .width = tw - (2 * c->bw), .height = h - (2 * c->bw) }, 0); + resize(c, (struct wlr_box) { .x = tx, .y = ty, .width = tw, .height = h }, 0);
+ if (tw != m->w.width) + if (tw != m->w.width)
+ tx += c->geom.width; + tx += c->geom.width;
+ } + }
@ -101,7 +101,7 @@ index ef27a1d..49209dc 100644
+static void +static void
+bstackhoriz(Monitor *m) { +bstackhoriz(Monitor *m) {
+ int w, mh, mx, tx, ty, th; + int w, mh, mx, tx, ty, th;
+ unsigned int i, n = 0; + int i, n = 0;
+ Client *c; + Client *c;
+ +
+ wl_list_for_each(c, &clients, link) + wl_list_for_each(c, &clients, link)
@ -111,7 +111,7 @@ index ef27a1d..49209dc 100644
+ return; + return;
+ +
+ if (n > m->nmaster) { + if (n > m->nmaster) {
+ mh = m->nmaster ? m->mfact * m->w.height : 0; + mh = ROUND(m->nmaster ? m->mfact * m->w.height : 0);
+ th = (m->w.height - mh) / (n - m->nmaster); + th = (m->w.height - mh) / (n - m->nmaster);
+ ty = m->w.y + mh; + ty = m->w.y + mh;
+ } else { + } else {
@ -126,10 +126,10 @@ index ef27a1d..49209dc 100644
+ continue; + continue;
+ if (i < m->nmaster) { + if (i < m->nmaster) {
+ w = (m->w.width - mx) / (MIN(n, m->nmaster) - i); + w = (m->w.width - mx) / (MIN(n, m->nmaster) - i);
+ resize(c, (struct wlr_box) { .x = m->w.x + mx, .y = m->w.y, .width = w - (2 * c->bw), .height = mh - (2 * c->bw) }, 0); + resize(c, (struct wlr_box) { .x = m->w.x + mx, .y = m->w.y, .width = w, .height = mh }, 0);
+ mx += c->geom.width; + mx += c->geom.width;
+ } else { + } else {
+ resize(c, (struct wlr_box) { .x = tx, .y = ty, .width = m->w.width - (2 * c->bw), .height = th - (2 * c->bw) }, 0); + resize(c, (struct wlr_box) { .x = tx, .y = ty, .width = m->w.width, .height = th }, 0);
+ if (th != m->w.height) + if (th != m->w.height)
+ ty += c->geom.height; + ty += c->geom.height;
+ } + }
@ -137,49 +137,5 @@ index ef27a1d..49209dc 100644
+ } + }
+} +}
-- --
2.42.0 2.43.2
From c28586c8b2328205bd578bf48110676d5ed04b7e Mon Sep 17 00:00:00 2001
From: wochap <gean.marroquin@gmail.com>
Date: Wed, 22 Nov 2023 19:03:00 -0500
Subject: [PATCH 2/2] [PATCH 2/2] fix main...Abanoub8:bottomstack.patch, remove
gaps
---
dwl.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dwl.c b/dwl.c
index 49209dc..6ad9187 100644
--- a/dwl.c
+++ b/dwl.c
@@ -2936,11 +2936,11 @@ bstack(Monitor *m)
continue;
if (i < m->nmaster) {
w = (m->w.width - mx) / (MIN(n, m->nmaster) - i);
- resize(c, (struct wlr_box) { .x = m->w.x + mx, .y = m->w.y, .width = w - (2 * c->bw), .height = mh - (2 * c->bw) }, 0);
+ resize(c, (struct wlr_box) { .x = m->w.x + mx, .y = m->w.y, .width = w, .height = mh }, 0);
mx += c->geom.width;
} else {
h = m->w.height - mh;
- resize(c, (struct wlr_box) { .x = tx, .y = ty, .width = tw - (2 * c->bw), .height = h - (2 * c->bw) }, 0);
+ resize(c, (struct wlr_box) { .x = tx, .y = ty, .width = tw, .height = h }, 0);
if (tw != m->w.width)
tx += c->geom.width;
}
@@ -2976,10 +2976,10 @@ bstackhoriz(Monitor *m) {
continue;
if (i < m->nmaster) {
w = (m->w.width - mx) / (MIN(n, m->nmaster) - i);
- resize(c, (struct wlr_box) { .x = m->w.x + mx, .y = m->w.y, .width = w - (2 * c->bw), .height = mh - (2 * c->bw) }, 0);
+ resize(c, (struct wlr_box) { .x = m->w.x + mx, .y = m->w.y, .width = w, .height = mh }, 0);
mx += c->geom.width;
} else {
- resize(c, (struct wlr_box) { .x = tx, .y = ty, .width = m->w.width - (2 * c->bw), .height = th - (2 * c->bw) }, 0);
+ resize(c, (struct wlr_box) { .x = tx, .y = ty, .width = m->w.width, .height = th }, 0);
if (th != m->w.height)
ty += c->geom.height;
}
--
2.42.0