diff options
Diffstat (limited to 'dwl-patches/patches/cfact')
-rw-r--r-- | dwl-patches/patches/cfact/README.md | 25 | ||||
-rw-r--r-- | dwl-patches/patches/cfact/cfact-v0.6.patch | 121 | ||||
-rw-r--r-- | dwl-patches/patches/cfact/cfact-v0.7-gaps.patch | 155 | ||||
-rw-r--r-- | dwl-patches/patches/cfact/cfact-v0.7.patch | 121 | ||||
-rw-r--r-- | dwl-patches/patches/cfact/cfact.patch | 121 |
5 files changed, 543 insertions, 0 deletions
diff --git a/dwl-patches/patches/cfact/README.md b/dwl-patches/patches/cfact/README.md new file mode 100644 index 0000000..166b4e2 --- /dev/null +++ b/dwl-patches/patches/cfact/README.md @@ -0,0 +1,25 @@ +### Description +A port of the [dwm cfacts patch](https://dwm.suckless.org/patches/cfacts/) (with the limits removed) + +Clients with higher weight are allocated more space! +``` ++---------------------+ +| | 0.5 | +| 1.0 +----------+ ++----------+ | +| | 1.0 | +| +----------+ +| 2.0 | | +| | 1.0 | ++----------+----------+` +``` +### Download +- [git branch](https://codeberg.org/Palanix/dwl/src/branch/cfact) +- [v0.7](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/cfact/cfact-v0.7.patch) +- [v0.7-gaps](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/cfact/cfact-v0.7-gaps.patch) +- [v0.6](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/cfact/cfact-v0.6.patch) +- [2024-02-15](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/cfact/cfact.patch) + +### Authors +- [dev-gm](https://codeberg.org/dev-gm) +- [Palanix](https://codeberg.org/Palanix) diff --git a/dwl-patches/patches/cfact/cfact-v0.6.patch b/dwl-patches/patches/cfact/cfact-v0.6.patch new file mode 100644 index 0000000..c1505fb --- /dev/null +++ b/dwl-patches/patches/cfact/cfact-v0.6.patch @@ -0,0 +1,121 @@ +From 52d8ed5ece7c96ea02441faaa4da2b0f51c8ebc4 Mon Sep 17 00:00:00 2001 +From: Palanix <palanixyt@gmail.com> +Date: Fri, 24 Nov 2023 21:16:56 +0100 +Subject: [PATCH] cweights to allow different size clients in normal layouts + +--- + config.def.h | 3 +++ + dwl.c | 32 ++++++++++++++++++++++++++++++-- + 2 files changed, 33 insertions(+), 2 deletions(-) + +diff --git a/config.def.h b/config.def.h +index 22d2171..d1bc596 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -133,6 +133,9 @@ static const Key keys[] = { + { MODKEY, XKB_KEY_d, incnmaster, {.i = -1} }, + { MODKEY, XKB_KEY_h, setmfact, {.f = -0.05f} }, + { MODKEY, XKB_KEY_l, setmfact, {.f = +0.05f} }, ++ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_H, setcfact, {.f = +0.25f} }, ++ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_L, setcfact, {.f = -0.25f} }, ++ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_K, setcfact, {.f = 0.0f} }, + { MODKEY, XKB_KEY_Return, zoom, {0} }, + { MODKEY, XKB_KEY_Tab, view, {0} }, + { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_C, killclient, {0} }, +diff --git a/dwl.c b/dwl.c +index 145fd01..68e35d2 100644 +--- a/dwl.c ++++ b/dwl.c +@@ -140,6 +140,7 @@ typedef struct { + uint32_t tags; + int isfloating, isurgent, isfullscreen; + uint32_t resize; /* configure serial of a pending resize */ ++ float cweight; + } Client; + + typedef struct { +@@ -318,6 +319,7 @@ static void requeststartdrag(struct wl_listener *listener, void *data); + static void requestmonstate(struct wl_listener *listener, void *data); + static void resize(Client *c, struct wlr_box geo, int interact); + static void run(char *startup_cmd); ++static void setcfact(const Arg *arg); + static void setcursor(struct wl_listener *listener, void *data); + static void setcursorshape(struct wl_listener *listener, void *data); + static void setfloating(Client *c, int floating); +@@ -1041,6 +1043,7 @@ createnotify(struct wl_listener *listener, void *data) + c = xdg_surface->data = ecalloc(1, sizeof(*c)); + c->surface.xdg = xdg_surface; + c->bw = borderpx; ++ c->cweight = 1.0; + + wlr_xdg_toplevel_set_wm_capabilities(xdg_surface->toplevel, + WLR_XDG_TOPLEVEL_WM_CAPABILITIES_FULLSCREEN); +@@ -2218,6 +2221,19 @@ run(char *startup_cmd) + wl_display_run(dpy); + } + ++void ++setcfact(const Arg *arg) ++{ ++ Client *sel = focustop(selmon); ++ ++ if(!arg || !sel || !selmon->lt[selmon->sellt]->arrange) ++ return; ++ sel->cweight = (float) (arg->f ? sel->cweight + arg->f : 1.0); ++ if (sel->cweight < 0) ++ sel->cweight = 0; ++ arrange(selmon); ++} ++ + void + setcursor(struct wl_listener *listener, void *data) + { +@@ -2637,6 +2653,7 @@ tile(Monitor *m) + { + unsigned int mw, my, ty; + int i, n = 0; ++ float mweight = 0, tweight = 0; + Client *c; + + wl_list_for_each(c, &clients, link) +@@ -2649,17 +2666,27 @@ tile(Monitor *m) + mw = m->nmaster ? (int)roundf(m->w.width * m->mfact) : 0; + else + mw = m->w.width; ++ i = 0; ++ wl_list_for_each(c, &clients, link){ ++ if (!VISIBLEON(c, m) || c->isfloating || c->isfullscreen) ++ continue; ++ if (i < m->nmaster) ++ mweight += c->cweight; ++ else ++ tweight += c->cweight; ++ i++; ++ } + i = my = ty = 0; + wl_list_for_each(c, &clients, link) { + if (!VISIBLEON(c, m) || c->isfloating || c->isfullscreen) + continue; + if (i < m->nmaster) { + resize(c, (struct wlr_box){.x = m->w.x, .y = m->w.y + my, .width = mw, +- .height = (m->w.height - my) / (MIN(n, m->nmaster) - i)}, 0); ++ .height = (int) ((c->cweight / mweight) * m->w.height)}, 0); + my += c->geom.height; + } else { + resize(c, (struct wlr_box){.x = m->w.x + mw, .y = m->w.y + ty, +- .width = m->w.width - mw, .height = (m->w.height - ty) / (n - i)}, 0); ++ .width = m->w.width - mw, .height = (int) ((c->cweight / tweight) * m->w.height) }, 0); + ty += c->geom.height; + } + i++; +@@ -3047,6 +3074,7 @@ createnotifyx11(struct wl_listener *listener, void *data) + c->surface.xwayland = xsurface; + c->type = X11; + c->bw = client_is_unmanaged(c) ? 0 : borderpx; ++ c->cweight = 1.0; + + /* Listen to the various events it can emit */ + LISTEN(&xsurface->events.associate, &c->associate, associatex11); +-- +2.45.2 + diff --git a/dwl-patches/patches/cfact/cfact-v0.7-gaps.patch b/dwl-patches/patches/cfact/cfact-v0.7-gaps.patch new file mode 100644 index 0000000..e080238 --- /dev/null +++ b/dwl-patches/patches/cfact/cfact-v0.7-gaps.patch @@ -0,0 +1,155 @@ +From 31d0ceb3f7dea83282e61e556d71d06b7f43d753 Mon Sep 17 00:00:00 2001 +From: Gavin M <git@gavinm.us> +Date: Sat, 16 Nov 2024 08:47:02 -0500 +Subject: [PATCH] Add cfact to gaps + +--- + config.def.h | 3 +++ + dwl.c | 63 +++++++++++++++++++++++++++++++++++++++++----------- + 2 files changed, 53 insertions(+), 13 deletions(-) + +diff --git a/config.def.h b/config.def.h +index b388b4e..a871364 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -136,6 +136,9 @@ static const Key keys[] = { + { MODKEY, XKB_KEY_d, incnmaster, {.i = -1} }, + { MODKEY, XKB_KEY_h, setmfact, {.f = -0.05f} }, + { MODKEY, XKB_KEY_l, setmfact, {.f = +0.05f} }, ++ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_H, setcfact, {.f = +0.25f} }, ++ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_L, setcfact, {.f = -0.25f} }, ++ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_K, setcfact, {.f = 0.0f} }, + { MODKEY, XKB_KEY_Return, zoom, {0} }, + { MODKEY, XKB_KEY_Tab, view, {0} }, + { MODKEY, XKB_KEY_g, togglegaps, {0} }, +diff --git a/dwl.c b/dwl.c +index dc851df..b5313c1 100644 +--- a/dwl.c ++++ b/dwl.c +@@ -140,6 +140,7 @@ typedef struct { + uint32_t tags; + int isfloating, isurgent, isfullscreen; + uint32_t resize; /* configure serial of a pending resize */ ++ float cweight; + } Client; + + typedef struct { +@@ -319,6 +320,7 @@ static void requeststartdrag(struct wl_listener *listener, void *data); + static void requestmonstate(struct wl_listener *listener, void *data); + static void resize(Client *c, struct wlr_box geo, int interact); + static void run(char *startup_cmd); ++static void setcfact(const Arg *arg); + static void setcursor(struct wl_listener *listener, void *data); + static void setcursorshape(struct wl_listener *listener, void *data); + static void setfloating(Client *c, int floating); +@@ -1045,6 +1047,7 @@ createnotify(struct wl_listener *listener, void *data) + c = xdg_surface->data = ecalloc(1, sizeof(*c)); + c->surface.xdg = xdg_surface; + c->bw = borderpx; ++ c->cweight = 1.0; + + wlr_xdg_toplevel_set_wm_capabilities(xdg_surface->toplevel, + WLR_XDG_TOPLEVEL_WM_CAPABILITIES_FULLSCREEN); +@@ -2223,6 +2226,19 @@ run(char *startup_cmd) + wl_display_run(dpy); + } + ++void ++setcfact(const Arg *arg) ++{ ++ Client *sel = focustop(selmon); ++ ++ if(!arg || !sel || !selmon->lt[selmon->sellt]->arrange) ++ return; ++ sel->cweight = (float) (arg->f ? sel->cweight + arg->f : 1.0); ++ if (sel->cweight < 0) ++ sel->cweight = 0; ++ arrange(selmon); ++} ++ + void + setcursor(struct wl_listener *listener, void *data) + { +@@ -2642,38 +2658,58 @@ tagmon(const Arg *arg) + void + tile(Monitor *m) + { +- unsigned int h, r, e = m->gaps, mw, my, ty; ++ unsigned int e = m->gaps, mw, my, ty; + int i, n = 0; +- Client *c; ++ float mweight = 0, tweight = 0; ++ Client *c, *sel = NULL; ++ ++ wl_list_for_each(c, &fstack, flink) { ++ if (VISIBLEON(c, m) && !c->isfullscreen) { ++ if (!sel) ++ sel = c; ++ if (!c->isfloating) ++ n++; ++ } ++ } + +- wl_list_for_each(c, &clients, link) +- if (VISIBLEON(c, m) && !c->isfloating && !c->isfullscreen) +- n++; + if (n == 0) + return; ++ + if (smartgaps == n) + e = 0; + + if (n > m->nmaster) + mw = m->nmaster ? (int)roundf((m->w.width + gappx*e) * m->mfact) : 0; + else +- mw = m->w.width; ++ mw = m->w.width - gappx*e; ++ ++ i = 0; ++ wl_list_for_each(c, &clients, link){ ++ if (!VISIBLEON(c, m) || c->isfloating || c->isfullscreen) ++ continue; ++ if (i < m->nmaster) ++ mweight += c->cweight; ++ else ++ tweight += c->cweight; ++ i++; ++ } ++ + i = 0; + my = ty = gappx*e; + wl_list_for_each(c, &clients, link) { + if (!VISIBLEON(c, m) || c->isfloating || c->isfullscreen) + continue; + if (i < m->nmaster) { +- r = MIN(n, m->nmaster) - i; +- h = (m->w.height - my - gappx*e - gappx*e * (r - 1)) / r; + resize(c, (struct wlr_box){.x = m->w.x + gappx*e, .y = m->w.y + my, +- .width = mw - 2*gappx*e, .height = h}, 0); ++ .width = mw - gappx*e, ++ .height = (int)((c->cweight / mweight) * (float)(m->w.height - gappx*e)) - gappx*e ++ }, 0); + my += c->geom.height + gappx*e; + } else { +- r = n - i; +- h = (m->w.height - ty - gappx*e - gappx*e * (r - 1)) / r; +- resize(c, (struct wlr_box){.x = m->w.x + mw, .y = m->w.y + ty, +- .width = m->w.width - mw - gappx*e, .height = h}, 0); ++ resize(c, (struct wlr_box){.x = m->w.x + mw + gappx*e, .y = m->w.y + ty, ++ .width = m->w.width - mw - 2*gappx*e, ++ .height = (int)((c->cweight / tweight) * (float)(m->w.height - gappx*e)) - gappx*e ++ }, 0); + ty += c->geom.height + gappx*e; + } + i++; +@@ -3068,6 +3104,7 @@ createnotifyx11(struct wl_listener *listener, void *data) + c->surface.xwayland = xsurface; + c->type = X11; + c->bw = client_is_unmanaged(c) ? 0 : borderpx; ++ c->cweight = 1.0; + + /* Listen to the various events it can emit */ + LISTEN(&xsurface->events.associate, &c->associate, associatex11); +-- +2.47.0 + diff --git a/dwl-patches/patches/cfact/cfact-v0.7.patch b/dwl-patches/patches/cfact/cfact-v0.7.patch new file mode 100644 index 0000000..7d28a8b --- /dev/null +++ b/dwl-patches/patches/cfact/cfact-v0.7.patch @@ -0,0 +1,121 @@ +From e82e15860c36a70539625b8fe7b4bd54d0721705 Mon Sep 17 00:00:00 2001 +From: Palanix <palanixyt@gmail.com> +Date: Fri, 24 Nov 2023 21:16:56 +0100 +Subject: [PATCH] cweights to allow different size clients in normal layouts + +--- + config.def.h | 3 +++ + dwl.c | 32 ++++++++++++++++++++++++++++++-- + 2 files changed, 33 insertions(+), 2 deletions(-) + +diff --git a/config.def.h b/config.def.h +index 22d2171..d1bc596 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -133,6 +133,9 @@ static const Key keys[] = { + { MODKEY, XKB_KEY_d, incnmaster, {.i = -1} }, + { MODKEY, XKB_KEY_h, setmfact, {.f = -0.05f} }, + { MODKEY, XKB_KEY_l, setmfact, {.f = +0.05f} }, ++ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_H, setcfact, {.f = +0.25f} }, ++ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_L, setcfact, {.f = -0.25f} }, ++ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_K, setcfact, {.f = 0.0f} }, + { MODKEY, XKB_KEY_Return, zoom, {0} }, + { MODKEY, XKB_KEY_Tab, view, {0} }, + { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_C, killclient, {0} }, +diff --git a/dwl.c b/dwl.c +index 5bf995e..5a17343 100644 +--- a/dwl.c ++++ b/dwl.c +@@ -141,6 +141,7 @@ typedef struct { + uint32_t tags; + int isfloating, isurgent, isfullscreen; + uint32_t resize; /* configure serial of a pending resize */ ++ float cweight; + } Client; + + typedef struct { +@@ -322,6 +323,7 @@ static void requeststartdrag(struct wl_listener *listener, void *data); + static void requestmonstate(struct wl_listener *listener, void *data); + static void resize(Client *c, struct wlr_box geo, int interact); + static void run(char *startup_cmd); ++static void setcfact(const Arg *arg); + static void setcursor(struct wl_listener *listener, void *data); + static void setcursorshape(struct wl_listener *listener, void *data); + static void setfloating(Client *c, int floating); +@@ -1060,6 +1062,7 @@ createnotify(struct wl_listener *listener, void *data) + c = toplevel->base->data = ecalloc(1, sizeof(*c)); + c->surface.xdg = toplevel->base; + c->bw = borderpx; ++ c->cweight = 1.0; + + LISTEN(&toplevel->base->surface->events.commit, &c->commit, commitnotify); + LISTEN(&toplevel->base->surface->events.map, &c->map, mapnotify); +@@ -2268,6 +2271,19 @@ run(char *startup_cmd) + wl_display_run(dpy); + } + ++void ++setcfact(const Arg *arg) ++{ ++ Client *sel = focustop(selmon); ++ ++ if(!arg || !sel || !selmon->lt[selmon->sellt]->arrange) ++ return; ++ sel->cweight = (float) (arg->f ? sel->cweight + arg->f : 1.0); ++ if (sel->cweight < 0) ++ sel->cweight = 0; ++ arrange(selmon); ++} ++ + void + setcursor(struct wl_listener *listener, void *data) + { +@@ -2692,6 +2708,7 @@ tile(Monitor *m) + { + unsigned int mw, my, ty; + int i, n = 0; ++ float mweight = 0, tweight = 0; + Client *c; + + wl_list_for_each(c, &clients, link) +@@ -2704,17 +2721,27 @@ tile(Monitor *m) + mw = m->nmaster ? (int)roundf(m->w.width * m->mfact) : 0; + else + mw = m->w.width; ++ i = 0; ++ wl_list_for_each(c, &clients, link){ ++ if (!VISIBLEON(c, m) || c->isfloating || c->isfullscreen) ++ continue; ++ if (i < m->nmaster) ++ mweight += c->cweight; ++ else ++ tweight += c->cweight; ++ i++; ++ } + i = my = ty = 0; + wl_list_for_each(c, &clients, link) { + if (!VISIBLEON(c, m) || c->isfloating || c->isfullscreen) + continue; + if (i < m->nmaster) { + resize(c, (struct wlr_box){.x = m->w.x, .y = m->w.y + my, .width = mw, +- .height = (m->w.height - my) / (MIN(n, m->nmaster) - i)}, 0); ++ .height = (int) ((c->cweight / mweight) * m->w.height)}, 0); + my += c->geom.height; + } else { + resize(c, (struct wlr_box){.x = m->w.x + mw, .y = m->w.y + ty, +- .width = m->w.width - mw, .height = (m->w.height - ty) / (n - i)}, 0); ++ .width = m->w.width - mw, .height = (int) ((c->cweight / tweight) * m->w.height) }, 0); + ty += c->geom.height; + } + i++; +@@ -3102,6 +3129,7 @@ createnotifyx11(struct wl_listener *listener, void *data) + c->surface.xwayland = xsurface; + c->type = X11; + c->bw = client_is_unmanaged(c) ? 0 : borderpx; ++ c->cweight = 1.0; + + /* Listen to the various events it can emit */ + LISTEN(&xsurface->events.associate, &c->associate, associatex11); +-- +2.45.2 + diff --git a/dwl-patches/patches/cfact/cfact.patch b/dwl-patches/patches/cfact/cfact.patch new file mode 100644 index 0000000..c91d3c0 --- /dev/null +++ b/dwl-patches/patches/cfact/cfact.patch @@ -0,0 +1,121 @@ +From 98fe302cd240b519c28c886250273854844ab2c7 Mon Sep 17 00:00:00 2001 +From: Palanix <palanixyt@gmail.com> +Date: Fri, 24 Nov 2023 21:16:56 +0100 +Subject: [PATCH] cweights to allow different size clients in normal layouts + +--- + config.def.h | 3 +++ + dwl.c | 32 ++++++++++++++++++++++++++++++-- + 2 files changed, 33 insertions(+), 2 deletions(-) + +diff --git a/config.def.h b/config.def.h +index 9009517..27ff521 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -128,6 +128,9 @@ static const Key keys[] = { + { MODKEY, XKB_KEY_d, incnmaster, {.i = -1} }, + { MODKEY, XKB_KEY_h, setmfact, {.f = -0.05f} }, + { MODKEY, XKB_KEY_l, setmfact, {.f = +0.05f} }, ++ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_H, setcfact, {.f = +0.25f} }, ++ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_L, setcfact, {.f = -0.25f} }, ++ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_K, setcfact, {.f = 0.0f} }, + { MODKEY, XKB_KEY_Return, zoom, {0} }, + { MODKEY, XKB_KEY_Tab, view, {0} }, + { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_C, killclient, {0} }, +diff --git a/dwl.c b/dwl.c +index fa76db2..9bdb438 100644 +--- a/dwl.c ++++ b/dwl.c +@@ -136,6 +136,7 @@ typedef struct { + uint32_t tags; + int isfloating, isurgent, isfullscreen; + uint32_t resize; /* configure serial of a pending resize */ ++ float cweight; + } Client; + + typedef struct { +@@ -301,6 +302,7 @@ static void requeststartdrag(struct wl_listener *listener, void *data); + static void requestmonstate(struct wl_listener *listener, void *data); + static void resize(Client *c, struct wlr_box geo, int interact); + static void run(char *startup_cmd); ++static void setcfact(const Arg *arg); + static void setcursor(struct wl_listener *listener, void *data); + static void setcursorshape(struct wl_listener *listener, void *data); + static void setfloating(Client *c, int floating); +@@ -956,6 +958,7 @@ createnotify(struct wl_listener *listener, void *data) + c = xdg_surface->data = ecalloc(1, sizeof(*c)); + c->surface.xdg = xdg_surface; + c->bw = borderpx; ++ c->cweight = 1.0; + + wlr_xdg_toplevel_set_wm_capabilities(xdg_surface->toplevel, + WLR_XDG_TOPLEVEL_WM_CAPABILITIES_FULLSCREEN); +@@ -2009,6 +2012,19 @@ run(char *startup_cmd) + wl_display_run(dpy); + } + ++void ++setcfact(const Arg *arg) ++{ ++ Client *sel = focustop(selmon); ++ ++ if(!arg || !sel || !selmon->lt[selmon->sellt]->arrange) ++ return; ++ sel->cweight = (float) (arg->f ? sel->cweight + arg->f : 1.0); ++ if (sel->cweight < 0) ++ sel->cweight = 0; ++ arrange(selmon); ++} ++ + void + setcursor(struct wl_listener *listener, void *data) + { +@@ -2468,6 +2484,7 @@ tile(Monitor *m) + { + unsigned int mw, my, ty; + int i, n = 0; ++ float mweight = 0, tweight = 0; + Client *c; + + wl_list_for_each(c, &clients, link) +@@ -2480,17 +2497,27 @@ tile(Monitor *m) + mw = m->nmaster ? ROUND(m->w.width * m->mfact) : 0; + else + mw = m->w.width; ++ i = 0; ++ wl_list_for_each(c, &clients, link){ ++ if (!VISIBLEON(c, m) || c->isfloating || c->isfullscreen) ++ continue; ++ if (i < m->nmaster) ++ mweight += c->cweight; ++ else ++ tweight += c->cweight; ++ i++; ++ } + i = my = ty = 0; + wl_list_for_each(c, &clients, link) { + if (!VISIBLEON(c, m) || c->isfloating || c->isfullscreen) + continue; + if (i < m->nmaster) { + resize(c, (struct wlr_box){.x = m->w.x, .y = m->w.y + my, .width = mw, +- .height = (m->w.height - my) / (MIN(n, m->nmaster) - i)}, 0); ++ .height = (int) ((c->cweight / mweight) * m->w.height)}, 0); + my += c->geom.height; + } else { + resize(c, (struct wlr_box){.x = m->w.x + mw, .y = m->w.y + ty, +- .width = m->w.width - mw, .height = (m->w.height - ty) / (n - i)}, 0); ++ .width = m->w.width - mw, .height = (int) ((c->cweight / tweight) * m->w.height) }, 0); + ty += c->geom.height; + } + i++; +@@ -2872,6 +2899,7 @@ createnotifyx11(struct wl_listener *listener, void *data) + c->surface.xwayland = xsurface; + c->type = X11; + c->bw = borderpx; ++ c->cweight = 1.0; + + /* Listen to the various events it can emit */ + LISTEN(&xsurface->events.associate, &c->associate, associatex11); +-- +2.43.1 + |