sites

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

commit e5b47b0abbd23f4cfb03c48f6e267387d724e3f7
parent 9a59791ff7e1534edb0f88d2379cd1333479203c
Author: Alex Cole <ajzcole@airmail.cc>
Date:   Thu, 19 Nov 2020 11:39:22 +1300

[dwm][patch][floatrules] Fixed a bug that removed borders from floating rule-less windows

Diffstat:
Adwm.suckless.org/patches/floatrules/dwm-floatrules-20201119-d08dd9c.diff | 68++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mdwm.suckless.org/patches/floatrules/index.md | 8+++++++-
2 files changed, 75 insertions(+), 1 deletion(-)

diff --git a/dwm.suckless.org/patches/floatrules/dwm-floatrules-20201119-d08dd9c.diff b/dwm.suckless.org/patches/floatrules/dwm-floatrules-20201119-d08dd9c.diff @@ -0,0 +1,68 @@ +diff -u dwm/config.def.h dwmnew/config.def.h +--- dwm/config.def.h 2020-03-01 19:10:06.676821764 +1300 ++++ dwmnew/config.def.h 2020-03-01 19:29:26.276901430 +1300 +@@ -26,9 +26,9 @@ + * WM_CLASS(STRING) = instance, class + * WM_NAME(STRING) = title + */ +- /* class instance title tags mask isfloating monitor */ +- { "Gimp", NULL, NULL, 0, 1, -1 }, +- { "Firefox", NULL, NULL, 1 << 8, 0, -1 }, ++ /* class instance title tags mask isfloating monitor float x,y,w,h floatborderpx*/ ++ { "Gimp", NULL, NULL, 0, 1, -1, 50,50,500,500, 5 }, ++ { "Firefox", NULL, NULL, 1 << 8, 0, -1, 50,50,500,500, 5 }, + }; + + /* layout(s) */ +Only in dwmnew: config.h +Only in dwmnew: drw.o +diff -u dwm/dwm.c dwmnew/dwm.c +--- dwm/dwm.c 2020-03-01 19:10:06.680155097 +1300 ++++ dwmnew/dwm.c 2020-03-01 19:28:26.793564016 +1300 +@@ -93,6 +93,7 @@ + int bw, oldbw; + unsigned int tags; + int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen; ++ int floatborderpx; ++ int hasfloatbw; + Client *next; + Client *snext; + Monitor *mon; +@@ -139,6 +140,8 @@ + unsigned int tags; + int isfloating; + int monitor; ++ int floatx, floaty, floatw, floath; ++ int floatborderpx; + } Rule; + + /* function declarations */ +@@ -299,6 +302,13 @@ + { + c->isfloating = r->isfloating; + c->tags |= r->tags; ++ if (c->floatborderpx >= 0) { ++ c->floatborderpx = r->floatborderpx; ++ c->hasfloatbw = 1; ++ } ++ if (r->isfloating) { ++ c->x = c->mon->mx + r->floatx; ++ c->y = r->floaty; ++ c->w = r->floatw; ++ c->h = r->floath; ++ } + for (m = mons; m && m->num != r->monitor; m = m->next); + if (m) + c->mon = m; +@@ -1281,7 +1291,10 @@ + 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; ++ if (c->isfloating && c->hasfloatbw && !c->isfullscreen) ++ wc.border_width = c->floatborderpx; ++ else ++ wc.border_width = c->bw; + XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc); + configure(c); + XSync(dpy, False); diff --git a/dwm.suckless.org/patches/floatrules/index.md b/dwm.suckless.org/patches/floatrules/index.md @@ -9,20 +9,24 @@ This patch adds 5 extra variables to the 'rules' array in `config.def.h`. These * `floatx`, `floaty`, `floatw`, `floath` (if the window has the rule `isfloating`, the window will spawn with the geometry specified by these vairables) * `floatborderpx` (border width when window is floating) +Setting `floatborderpx` to `-1` (or any value less than zero) will mean that the regular border width is used. + Please note that this patch needs `rm config.h` to be added to the `Makefile`. -Using the latest version is recommended, as there have been a couple of bug fixes since the first. +Using the latest version is recommended as there have been a couple of bug fixes since the first. Screenshots: ![floatrules screenshot](floatrules.png) Updates ------- +* 2020-11-19: Fixed a bug that caused rule-less windows to have no border (Alex Cole) * 2020-11-14: Fixed a bug that added borders to fullscreen windows (Alex Cole) * 2020-11-07: Added support for multiple monitors (Alex Cole) * 2020-03-22: Typo fix (Jakub Profota) Download -------- +* [dwm-floatrules-20201119-d08dd9c.diff](dwm-floatrules-20201119-d08dd9c.diff) * [dwm-floatrules-20201114-d08dd9c.diff](dwm-floatrules-20201114-d08dd9c.diff) * [dwm-floatrules-20201107-61bb8b2.diff](dwm-floatrules-20201107-61bb8b2.diff) * [dwm-floatrules-6.2.diff](dwm-floatrules-6.2.diff) (2020-03-01) @@ -31,3 +35,5 @@ Author ------ * Alex Cole (original) <ajzcole at airmail.cc> * Jakub Profota + +The original author would like to apologise for the several bugs that originally plagued even this relatively simple patch.