summaryrefslogtreecommitdiffhomepage
path: root/patch
diff options
context:
space:
mode:
authorbakkeby <[email protected]>2020-08-27 21:05:34 +0200
committerbakkeby <[email protected]>2020-08-27 21:05:34 +0200
commitc44b14e3dd063cbe85ac152229991411c67de3dc (patch)
tree325799d94b5fc72303f94402b799e84dfbd7f5b6 /patch
parentb3d336322e56637c7e157a44695dab6def2fcb05 (diff)
downloaddwm-flexipatch-c44b14e3dd063cbe85ac152229991411c67de3dc.tar.gz
dwm-flexipatch-c44b14e3dd063cbe85ac152229991411c67de3dc.zip
setborderpx compatibility improvements
Diffstat (limited to 'patch')
-rw-r--r--patch/decorationhints.c10
-rw-r--r--patch/exresize.c9
-rw-r--r--patch/maximize.c22
3 files changed, 35 insertions, 6 deletions
diff --git a/patch/decorationhints.c b/patch/decorationhints.c
index a7498ee..6636998 100644
--- a/patch/decorationhints.c
+++ b/patch/decorationhints.c
@@ -14,16 +14,20 @@ updatemotifhints(Client *c)
return;
if (XGetWindowProperty(dpy, c->win, motifatom, 0L, 5L, False, motifatom,
- &real, &format, &n, &extra, &p) == Success && p != NULL) {
+ &real, &format, &n, &extra, &p) == Success && p != NULL) {
motif = (unsigned long*)p;
if (motif[MWM_HINTS_FLAGS_FIELD] & MWM_HINTS_DECORATIONS) {
width = WIDTH(c);
height = HEIGHT(c);
if (motif[MWM_HINTS_DECORATIONS_FIELD] & MWM_DECOR_ALL ||
- motif[MWM_HINTS_DECORATIONS_FIELD] & MWM_DECOR_BORDER ||
- motif[MWM_HINTS_DECORATIONS_FIELD] & MWM_DECOR_TITLE)
+ motif[MWM_HINTS_DECORATIONS_FIELD] & MWM_DECOR_BORDER ||
+ motif[MWM_HINTS_DECORATIONS_FIELD] & MWM_DECOR_TITLE)
+ #if SETBORDERPX_PATCH
+ c->bw = c->oldbw = c->mon->borderpx;
+ #else
c->bw = c->oldbw = borderpx;
+ #endif // SETBORDERPX_PATCH
else
c->bw = c->oldbw = 0;
diff --git a/patch/exresize.c b/patch/exresize.c
index 4d8d4b0..e9786b3 100644
--- a/patch/exresize.c
+++ b/patch/exresize.c
@@ -117,6 +117,11 @@ expand(unsigned char mask)
{
XEvent ev;
int nx1, ny1, nx2, ny2;
+ #if SETBORDERPX_PATCH
+ int bp = selmon->borderpx;
+ #else
+ int bp = borderpx;
+ #endif // SETBORDERPX_PATCH
unsigned char curmask;
unsigned char newmask;
@@ -142,7 +147,7 @@ expand(unsigned char mask)
nx2 = calculate_expand(mask, curmask, &newmask,
EXPAND_RIGHT, &selmon->sel->expandx2,
selmon->sel->x + selmon->sel->w,
- selmon->wx + selmon->ww - 2*borderpx,
+ selmon->wx + selmon->ww - 2*bp,
selmon->sel->oldw + selmon->sel->x);
ny1 = calculate_expand(mask, curmask, &newmask,
EXPAND_UP, &selmon->sel->expandy1,
@@ -152,7 +157,7 @@ expand(unsigned char mask)
ny2 = calculate_expand(mask, curmask, &newmask,
EXPAND_DOWN, &selmon->sel->expandy2,
selmon->sel->y + selmon->sel->h,
- selmon->wy + selmon->wh - 2*borderpx,
+ selmon->wy + selmon->wh - 2*bp,
selmon->sel->oldh + selmon->sel->y);
diff --git a/patch/maximize.c b/patch/maximize.c
index 77775f3..53336eb 100644
--- a/patch/maximize.c
+++ b/patch/maximize.c
@@ -30,6 +30,25 @@ maximize(int x, int y, int w, int h)
while (XCheckMaskEvent(dpy, EnterWindowMask, &ev));
}
+#if SETBORDERPX_PATCH
+void
+togglemax(const Arg *arg)
+{
+ maximize(selmon->wx, selmon->wy, selmon->ww - 2 * selmon->borderpx, selmon->wh - 2 * selmon->borderpx);
+}
+
+void
+toggleverticalmax(const Arg *arg)
+{
+ maximize(selmon->sel->x, selmon->wy, selmon->sel->w, selmon->wh - 2 * selmon->borderpx);
+}
+
+void
+togglehorizontalmax(const Arg *arg)
+{
+ maximize(selmon->wx, selmon->sel->y, selmon->ww - 2 * selmon->borderpx, selmon->sel->h);
+}
+#else
void
togglemax(const Arg *arg)
{
@@ -46,4 +65,5 @@ void
togglehorizontalmax(const Arg *arg)
{
maximize(selmon->wx, selmon->sel->y, selmon->ww - 2 * borderpx, selmon->sel->h);
-} \ No newline at end of file
+}
+#endif // SETBORDERPX_PATCH \ No newline at end of file