sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

commit 8c5fe52cdb0602969e3b86428cd3676e85f91c9b
parent b82d1858e8f742d7237dcb735a08c1ae14199c0d
Author: Cyril Cressent <cyril@cressent.org>
Date:   Wed,  3 Jul 2019 23:20:39 -0700

[dwm][patch][uselessgap] Port to 6.2

Diffstat:
Adwm.suckless.org/patches/uselessgap/dwm-uselessgap-6.2.diff | 81+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mdwm.suckless.org/patches/uselessgap/index.md | 4+++-
2 files changed, 84 insertions(+), 1 deletion(-)

diff --git a/dwm.suckless.org/patches/uselessgap/dwm-uselessgap-6.2.diff b/dwm.suckless.org/patches/uselessgap/dwm-uselessgap-6.2.diff @@ -0,0 +1,81 @@ +From 58a5ece9406ca6c90dc362617c065e4aac19417f Mon Sep 17 00:00:00 2001 +From: Cyril Cressent <cyril@cressent.org> +Date: Wed, 3 Jul 2019 21:33:45 -0700 +Subject: [PATCH] Port the uselessgap patch to 6.2 + +--- + config.def.h | 1 + + dwm.c | 36 ++++++++++++++++++++++++++++++------ + 2 files changed, 31 insertions(+), 6 deletions(-) + +diff --git a/config.def.h b/config.def.h +index 1c0b587..b11471d 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -2,6 +2,7 @@ + + /* appearance */ + static const unsigned int borderpx = 1; /* border pixel of windows */ ++static const unsigned int gappx = 6; /* gaps between windows */ + static const unsigned int snap = 32; /* snap pixel */ + static const int showbar = 1; /* 0 means no bar */ + static const int topbar = 1; /* 0 means bottom bar */ +diff --git a/dwm.c b/dwm.c +index 4465af1..4545e05 100644 +--- a/dwm.c ++++ b/dwm.c +@@ -52,8 +52,8 @@ + #define ISVISIBLE(C) ((C->tags & C->mon->tagset[C->mon->seltags])) + #define LENGTH(X) (sizeof X / sizeof X[0]) + #define MOUSEMASK (BUTTONMASK|PointerMotionMask) +-#define WIDTH(X) ((X)->w + 2 * (X)->bw) +-#define HEIGHT(X) ((X)->h + 2 * (X)->bw) ++#define WIDTH(X) ((X)->w + 2 * (X)->bw + gappx) ++#define HEIGHT(X) ((X)->h + 2 * (X)->bw + gappx) + #define TAGMASK ((1 << LENGTH(tags)) - 1) + #define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad) + +@@ -1276,12 +1276,36 @@ void + resizeclient(Client *c, int x, int y, int w, int h) + { + XWindowChanges wc; ++ unsigned int n; ++ unsigned int gapoffset; ++ unsigned int gapincr; ++ Client *nbc; + +- c->oldx = c->x; c->x = wc.x = x; +- c->oldy = c->y; c->y = wc.y = y; +- c->oldw = c->w; c->w = wc.width = w; +- c->oldh = c->h; c->h = wc.height = h; + wc.border_width = c->bw; ++ ++ /* Get number of clients for the selected monitor */ ++ for (n = 0, nbc = nexttiled(selmon->clients); nbc; nbc = nexttiled(nbc->next), n++); ++ ++ /* Do nothing if layout is floating */ ++ if (c->isfloating || selmon->lt[selmon->sellt]->arrange == NULL) { ++ gapincr = gapoffset = 0; ++ } else { ++ /* Remove border and gap if layout is monocle or only one client */ ++ if (selmon->lt[selmon->sellt]->arrange == monocle || n == 1) { ++ gapoffset = 0; ++ gapincr = -2 * borderpx; ++ wc.border_width = 0; ++ } else { ++ gapoffset = gappx; ++ gapincr = 2 * gappx; ++ } ++ } ++ ++ c->oldx = c->x; c->x = wc.x = x + gapoffset; ++ c->oldy = c->y; c->y = wc.y = y + gapoffset; ++ c->oldw = c->w; c->w = wc.width = w - gapincr; ++ c->oldh = c->h; c->h = wc.height = h - gapincr; ++ + XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc); + configure(c); + XSync(dpy, False); +-- +2.22.0 + diff --git a/dwm.suckless.org/patches/uselessgap/index.md b/dwm.suckless.org/patches/uselessgap/index.md @@ -47,6 +47,7 @@ tile mode... Download -------- +* [dwm-uselessgap-6.2.diff](dwm-uselessgap-6.2.diff) * [dwm-uselessgap-6.1.diff](dwm-uselessgap-6.1.diff) (4K) (20150815), now supports nmaster. * [dwm-uselessgap-5.9.diff](dwm-uselessgap-5.9.diff) (1.8k) (20110107 updated. Thanks Jordan for your bug report) Updated to use the new resizeclient() function instead of resize() @@ -55,4 +56,5 @@ Download Author ------ -* [jerome](http://blog.jardinmagique.info) <jerome@gcu.info> +* [jerome](http://blog.jardinmagique.info) - <jerome@gcu.info> +* [Cyril Cressent](https://cressent.org) - <cyril@cressent.org> (6.2 port)