[wiki] [sites] [dwm][patch][removeborder] Fix wrong window dimensions || Cássio Ribeiro Alves de Ávila

From: <git_AT_suckless.org>
Date: Sat, 01 May 2021 12:53:58 +0200

commit 0f7d4d638a77f35672a103483121d86b0732c2d3
Author: Cássio Ribeiro Alves de Ávila <cassioavila_AT_yandex.com>
Date: Sat May 1 07:50:27 2021 -0300

    [dwm][patch][removeborder] Fix wrong window dimensions
    
    The original patch just removes the border, and doesn't increase the
    dimensions of the window, leaving a space at the bottom.

diff --git a/dwm.suckless.org/patches/removeborder/dwm-removeborder-20200520-f09418b.diff b/dwm.suckless.org/patches/removeborder/dwm-removeborder-20200520-f09418b.diff
index 5414d6b2..73d75f4f 100644
--- a/dwm.suckless.org/patches/removeborder/dwm-removeborder-20200520-f09418b.diff
+++ b/dwm.suckless.org/patches/removeborder/dwm-removeborder-20200520-f09418b.diff
_AT_@ -1,13 +1,13 @@
 diff --git a/dwm.c b/dwm.c
-index 9fd0286..dcdbc38 100644
+index 4465af1..f869429 100644
 --- a/dwm.c
 +++ b/dwm.c
-_AT_@ -1277,12 +1277,24 @@ void
+_AT_@ -1276,12 +1276,26 @@ void
  resizeclient(Client *c, int x, int y, int w, int h)
  {
          XWindowChanges wc;
-+ unsigned int n;
-+ Client *nbc;
++ unsigned int n;
++ Client *nbc;
  
          c->oldx = c->x; c->x = wc.x = x;
          c->oldy = c->y; c->y = wc.y = y;
_AT_@ -15,14 +15,16 @@ index 9fd0286..dcdbc38 100644
          c->oldh = c->h; c->h = wc.height = h;
          wc.border_width = c->bw;
 +
-+ for (n = 0, nbc = nexttiled(selmon->clients); nbc; nbc = nexttiled(nbc->next), n++);
++ for (n = 0, nbc = nexttiled(selmon->clients); nbc; nbc = nexttiled(nbc->next), n++);
 +
-+ if (c->isfloating || selmon->lt[selmon->sellt]->arrange == NULL) {
-+ } else {
-+ if (selmon->lt[selmon->sellt]->arrange == monocle || n == 1) {
-+ wc.border_width = 0;
-+ }
-+ }
++ if (c->isfloating || selmon->lt[selmon->sellt]->arrange == NULL) {
++ } else {
++ if (selmon->lt[selmon->sellt]->arrange == monocle || n == 1) {
++ wc.border_width = 0;
++ c->w = wc.width += c->bw * 2;
++ c->h = wc.height += c->bw * 2;
++ }
++ }
 +
          XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc);
          configure(c);
diff --git a/dwm.suckless.org/patches/removeborder/index.md b/dwm.suckless.org/patches/removeborder/index.md
index 4af52145..66f1e6a6 100644
--- a/dwm.suckless.org/patches/removeborder/index.md
+++ b/dwm.suckless.org/patches/removeborder/index.md
_AT_@ -12,3 +12,4 @@ Download
 Author
 -------
 * Max Amundsen - <massimo_AT_cdrateline.com>
+* Cássio Ávila - <cassioavila_AT_yandex.com> (window dimensions fix)
Received on Sat May 01 2021 - 12:53:58 CEST

This archive was generated by hypermail 2.3.0 : Sat May 01 2021 - 13:00:52 CEST