summaryrefslogtreecommitdiffhomepage
path: root/patch
diff options
context:
space:
mode:
authorbakkeby <[email protected]>2019-11-04 08:17:00 +0100
committerbakkeby <[email protected]>2019-11-04 15:17:19 +0100
commit42b66d4b29082f237e5b368dfa97e18801a203fd (patch)
tree3c96a868b2cf48e81f0b690a127bc76a5bacd3ce /patch
parent2112ea927f15525a541553ca680677664e73ffe1 (diff)
downloaddwm-flexipatch-42b66d4b29082f237e5b368dfa97e18801a203fd.tar.gz
dwm-flexipatch-42b66d4b29082f237e5b368dfa97e18801a203fd.zip
Addressed some conflicts between CMDCUSTOMIZE and NODMENU patches as well as between EXRESIZE and MAXIMIZE patches
Diffstat (limited to 'patch')
-rw-r--r--patch/exresize.c26
-rw-r--r--patch/include.c4
-rw-r--r--patch/include.h4
-rw-r--r--patch/maximize.c22
-rw-r--r--patch/maximize.h2
5 files changed, 34 insertions, 24 deletions
diff --git a/patch/exresize.c b/patch/exresize.c
index 31591b0..4d8d4b0 100644
--- a/patch/exresize.c
+++ b/patch/exresize.c
@@ -11,7 +11,8 @@
#define FORCE_EXPANDALL ~0 // Force expand in all directions
void
-exresize(const Arg *arg) {
+exresize(const Arg *arg)
+{
Client *c;
int x, y, nx, ny, nw, nh;
c = selmon->sel;
@@ -59,7 +60,8 @@ exresize(const Arg *arg) {
}
void
-explace(const Arg *arg) {
+explace(const Arg *arg)
+{
Client *c;
int nx, ny;
@@ -87,13 +89,13 @@ int
calculate_expand(unsigned char mask, unsigned char curmask,
unsigned char *newmask, unsigned char key,
int *reset_value, int new_reset_value,
- int max_value, int old_value) {
+ int max_value, int old_value)
+{
if (IS_SET(key, mask) ||
(IS_SET(key, curmask) && (!IS_SET(key, mask) && IS_FORCED(key, mask))) ||
(!IS_SET(key, curmask) && (IS_SET(key, mask) && IS_FORCED(key, mask)))) {
- if (IS_SET(key, mask) && (!IS_SET(key,curmask) || IS_FORCED(key,mask)))
- {
+ if (IS_SET(key, mask) && (!IS_SET(key,curmask) || IS_FORCED(key,mask))) {
if (!IS_SET(key, curmask))
*reset_value = new_reset_value;
*newmask |= key;
@@ -111,13 +113,14 @@ calculate_expand(unsigned char mask, unsigned char curmask,
}
void
-expand(unsigned char mask) {
+expand(unsigned char mask)
+{
XEvent ev;
int nx1, ny1, nx2, ny2;
unsigned char curmask;
unsigned char newmask;
- if(!selmon->sel || selmon->sel->isfixed)
+ if (!selmon->sel || selmon->sel->isfixed)
return;
XRaiseWindow(dpy, selmon->sel->win);
newmask = curmask = selmon->sel->expandmask;
@@ -163,21 +166,24 @@ expand(unsigned char mask) {
}
void
-togglemaximize(const Arg *arg) {
+togglemaximize(const Arg *arg)
+{
if (arg->i > 0) expand(FORCE_EXPANDALL);
else if (arg->i < 0) expand(UNEXPAND);
else expand(EXPANDALL);
}
void
-toggleverticalexpand(const Arg *arg) {
+toggleverticalexpand(const Arg *arg)
+{
if (arg->i < 0) expand(EXPAND_DOWN);
else if (arg->i > 0) expand(EXPAND_UP);
else expand(EXPAND_DOWN | EXPAND_UP);
}
void
-togglehorizontalexpand(const Arg *arg) {
+togglehorizontalexpand(const Arg *arg)
+{
if (arg->i < 0) expand(EXPAND_LEFT);
else if (arg->i > 0) expand(EXPAND_RIGHT);
else expand(EXPAND_LEFT | EXPAND_RIGHT);
diff --git a/patch/include.c b/patch/include.c
index 5166174..9b0fd0d 100644
--- a/patch/include.c
+++ b/patch/include.c
@@ -17,7 +17,7 @@
#if CFACTS_PATCH
#include "cfacts.c"
#endif
-#if CMDCUSTOMIZE
+#if CMDCUSTOMIZE_PATCH
#include "cmdcustomize.c"
#endif
#if COMBO_PATCH
@@ -174,4 +174,4 @@
#endif
#if TILE_LAYOUT
#include "tile.c"
-#endif \ No newline at end of file
+#endif
diff --git a/patch/include.h b/patch/include.h
index 9c1980f..4ae5675 100644
--- a/patch/include.h
+++ b/patch/include.h
@@ -17,7 +17,7 @@
#if CFACTS_PATCH
#include "cfacts.h"
#endif
-#if CMDCUSTOMIZE
+#if CMDCUSTOMIZE_PATCH
#include "cmdcustomize.h"
#endif
#if COMBO_PATCH
@@ -174,4 +174,4 @@
#endif
#if TILE_LAYOUT
#include "tile.h"
-#endif \ No newline at end of file
+#endif
diff --git a/patch/maximize.c b/patch/maximize.c
index 6f89538..77775f3 100644
--- a/patch/maximize.c
+++ b/patch/maximize.c
@@ -1,12 +1,13 @@
void
-maximize(int x, int y, int w, int h) {
+maximize(int x, int y, int w, int h)
+{
XEvent ev;
- if(!selmon->sel || selmon->sel->isfixed)
+ if (!selmon->sel || selmon->sel->isfixed)
return;
XRaiseWindow(dpy, selmon->sel->win);
- if(!selmon->sel->ismax) {
- if(!selmon->lt[selmon->sellt]->arrange || selmon->sel->isfloating)
+ if (!selmon->sel->ismax) {
+ if (!selmon->lt[selmon->sellt]->arrange || selmon->sel->isfloating)
selmon->sel->wasfloating = True;
else {
togglefloating(NULL);
@@ -21,25 +22,28 @@ maximize(int x, int y, int w, int h) {
}
else {
resize(selmon->sel, selmon->sel->oldx, selmon->sel->oldy, selmon->sel->oldw, selmon->sel->oldh, True);
- if(!selmon->sel->wasfloating)
+ if (!selmon->sel->wasfloating)
togglefloating(NULL);
selmon->sel->ismax = False;
}
drawbar(selmon);
- while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
+ while (XCheckMaskEvent(dpy, EnterWindowMask, &ev));
}
void
-togglemaximize(const Arg *arg) {
+togglemax(const Arg *arg)
+{
maximize(selmon->wx, selmon->wy, selmon->ww - 2 * borderpx, selmon->wh - 2 * borderpx);
}
void
-toggleverticalmax(const Arg *arg) {
+toggleverticalmax(const Arg *arg)
+{
maximize(selmon->sel->x, selmon->wy, selmon->sel->w, selmon->wh - 2 * borderpx);
}
void
-togglehorizontalmax(const Arg *arg) {
+togglehorizontalmax(const Arg *arg)
+{
maximize(selmon->wx, selmon->sel->y, selmon->ww - 2 * borderpx, selmon->sel->h);
} \ No newline at end of file
diff --git a/patch/maximize.h b/patch/maximize.h
index a71226a..e06a3ff 100644
--- a/patch/maximize.h
+++ b/patch/maximize.h
@@ -1,4 +1,4 @@
static void maximize(int x, int y, int w, int h);
-static void togglemaximize(const Arg *arg);
+static void togglemax(const Arg *arg);
static void toggleverticalmax(const Arg *arg);
static void togglehorizontalmax(const Arg *arg); \ No newline at end of file