commit b363b823beb029c452b842dfbd1d1e2a3ceed742
parent c5f2420f812f69437971dee6ecdf0027f342ddbf
Author: wh1tepearl <wh1tepearl@gmail.com>
Date: Sun, 1 Feb 2026 19:49:03 +0000
Bug fix, spelling in code fix, ALL warnings fix
Diffstat:
10 files changed, 41 insertions(+), 67 deletions(-)
diff --git a/README.md b/README.md
@@ -3,7 +3,7 @@
# Features
vxwm is dwm on steroids, it can be as lightweight as you want.
It has some patches for dwm pre installed that can be enabled/disabled by switching 0 to 1 or vice versa. (like in dwm-flexipatch)
-It also has some unique features like 8 sided resize, enchanced toggle floating, warp cursor and more! (They also can be toggled)
+It also has some unique features like 8 sided resize, enhanced toggle floating, warp cursor and more! (They also can be toggled)
Check modules.def.h for full list of features.
## Requirements
diff --git a/config.def.h b/config.def.h
@@ -140,8 +140,13 @@ static const Key keys[] = {
#if FULLSCREEN
{ MODKEY|ShiftMask, XK_f, togglefullscr, {0} },
#endif
-#if ENCHANCED_TOGGLE_FLOATING
- { MODKEY, XK_q, enchancedtogglefloating, {0} }, //enchanced toggle floating bind.
+#if ENHANCED_TOGGLE_FLOATING
+ { MODKEY, XK_q, enhancedtogglefloating, {0} }, //enhanced toggle floating bind.
+#endif
+#if GAPS
+ { MODKEY, XK_minus, setgaps, {.i = -1 } },
+ { MODKEY, XK_equal, setgaps, {.i = +1 } },
+ { MODKEY|ShiftMask, XK_equal, setgaps, {.i = 0 } },
#endif
};
diff --git a/modules.def.h b/modules.def.h
@@ -36,7 +36,7 @@
/* Floating */ // Recomended to use with ALWAYS_CENTER_NEW_FLOATING_WINDOWS set to 1.
#define FLOATING_LAYOUT_FLOATS_WINDOWS 0 // By default, in floating layout, windows appear to be floating, but, for dwm, they are not. Because of this, when switching to tiled layout after floating layout, windows will be tiled, enable this if you don't want that behaviour.
-#define ENCHANCED_TOGGLE_FLOATING 0 // Support for enchanced toggle floating, when toggling floating window will resize to its natural size, and in floating layout, window will be tiled.
+#define ENHANCED_TOGGLE_FLOATING 0 // Support for enhanced toggle floating, when toggling floating window will resize to its natural size, and in floating layout, window will be tiled.
#define RESTORE_SIZE_AND_POS_ETF 0 // Restore previous size and position of window when toggling floating
#endif
diff --git a/modules/etf/etf.c b/modules/etf/etf.c
@@ -1,6 +1,6 @@
#if !RESTORE_SIZE_AND_POS_ETF
void
-enchancedtogglefloating(const Arg *arg)
+enhancedtogglefloating(const Arg *arg)
{
if (!selmon->sel || selmon->sel->isfullscreen)
return;
@@ -27,15 +27,14 @@ enchancedtogglefloating(const Arg *arg)
}
#else // fuck this shit i almost pulled out all my hair when i wrote this, but atleast it works lol
void
-enchancedtogglefloating(const Arg *arg)
+enhancedtogglefloating(const Arg *arg)
{
if (!selmon->sel || selmon->sel->isfullscreen)
return;
Client *c = selmon->sel;
- int wasfloating = c->isfloating;
- Layout *prevlayout = selmon->lt[selmon->sellt];
+ const Layout *prevlayout = selmon->lt[selmon->sellt];
c->isfloating = !c->isfloating;
@@ -43,10 +42,14 @@ enchancedtogglefloating(const Arg *arg)
int w = c->sfw > 0 ? c->sfw : c->w;
int h = c->sfh > 0 ? c->sfh : c->h;
- int x = c->sfx > 20 && c->sfy > 20 ? c->sfx : c->mon->wx + (c->mon->ww - w) / 2;
- int y = c->sfx > 20 && c->sfy > 20 ? c->sfy : c->mon->wy + (c->mon->wh - h) / 2;
-
- resize(c, x, y, w, h, 0);
+ if (!c->wasmanuallyedited) {
+ resize(c,
+ c->mon->wx + (c->mon->ww - w) / 2,
+ c->mon->wy + (c->mon->wh - h) / 2,
+ w, h, 0);
+ } else {
+ resize(c, c->sfx, c->sfy, w, h, 0);
+ }
c->sfx = c->x; c->sfy = c->y;
c->sfw = c->w; c->sfh = c->h;
diff --git a/modules/etf/etf.h b/modules/etf/etf.h
@@ -1 +1 @@
-void enchancedtogglefloating(const Arg *arg);
+void enhancedtogglefloating(const Arg *arg);
diff --git a/modules/ewmh_tags/ewmh_tags.c b/modules/ewmh_tags/ewmh_tags.c
@@ -26,7 +26,7 @@ void
updatecurrentdesktop(void){
long rawdata[] = { selmon->tagset[selmon->seltags] };
int i=0;
- while(*rawdata >> i+1){
+ while(*rawdata >> (i+1)){
i++;
}
long data[] = { i };
diff --git a/modules/vxwm_includes.c b/modules/vxwm_includes.c
@@ -21,7 +21,7 @@
#include "warptoclient/warptoclient.c"
#endif
-#if ENCHANCED_TOGGLE_FLOATING
+#if ENHANCED_TOGGLE_FLOATING
#include "etf/etf.c"
#endif
diff --git a/modules/vxwm_includes.h b/modules/vxwm_includes.h
@@ -21,7 +21,7 @@
#include "warptoclient/warptoclient.h"
#endif
-#if ENCHANCED_TOGGLE_FLOATING
+#if ENHANCED_TOGGLE_FLOATING
#include "etf/etf.h"
#endif
diff --git a/transient.c b/transient.c
@@ -1,42 +0,0 @@
-/* cc transient.c -o transient -lX11 */
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-
-int main(void) {
- Display *d;
- Window r, f, t = None;
- XSizeHints h;
- XEvent e;
-
- d = XOpenDisplay(NULL);
- if (!d)
- exit(1);
- r = DefaultRootWindow(d);
-
- f = XCreateSimpleWindow(d, r, 100, 100, 400, 400, 0, 0, 0);
- h.min_width = h.max_width = h.min_height = h.max_height = 400;
- h.flags = PMinSize | PMaxSize;
- XSetWMNormalHints(d, f, &h);
- XStoreName(d, f, "floating");
- XMapWindow(d, f);
-
- XSelectInput(d, f, ExposureMask);
- while (1) {
- XNextEvent(d, &e);
-
- if (t == None) {
- sleep(5);
- t = XCreateSimpleWindow(d, r, 50, 50, 100, 100, 0, 0, 0);
- XSetTransientForHint(d, t, f);
- XStoreName(d, t, "transient");
- XMapWindow(d, t);
- XSelectInput(d, t, ExposureMask);
- }
- }
-
- XCloseDisplay(d);
- exit(0);
-}
diff --git a/vxwm.c b/vxwm.c
@@ -97,8 +97,11 @@ struct Client {
Client *snext;
Monitor *mon;
Window win;
-#if ENCHANCED_TOGGLE_FLOATING
+#if ENHANCED_TOGGLE_FLOATING
int sfx, sfy, sfw, sfh;
+ #if RESTORE_SIZE_AND_POS_ETF
+ int wasmanuallyedited;
+ #endif
#endif
};
@@ -411,7 +414,8 @@ arrange(Monitor *m)
void
arrangemon(Monitor *m)
{
- strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, sizeof m->ltsymbol);
+ strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, sizeof m->ltsymbol - 1);
+ m->ltsymbol[sizeof m->ltsymbol - 1] = '\0';
if (m->lt[m->sellt]->arrange)
m->lt[m->sellt]->arrange(m);
}
@@ -1144,7 +1148,7 @@ manage(Window w, XWindowAttributes *wa)
c->w = c->oldw = wa->width;
c->h = c->oldh = wa->height;
c->oldbw = wa->border_width;
-#if ENCHANCED_TOGGLE_FLOATING
+#if ENHANCED_TOGGLE_FLOATING
c->sfx = c->x;
c->sfy = c->y;
c->sfw = c->w;
@@ -1376,7 +1380,8 @@ movemouse(const Arg *arg)
selmon = m;
focus(NULL);
}
-#if ENCHANCED_TOGGLE_FLOATING && RESTORE_SIZE_AND_POS_ETF
+#if ENHANCED_TOGGLE_FLOATING && RESTORE_SIZE_AND_POS_ETF
+ c->wasmanuallyedited = 1;
if (c->isfloating) {
c->sfx = c->x;
c->sfy = c->y;
@@ -1502,10 +1507,10 @@ resizemouse(const Arg *arg)
int rx, ry;
Window junkwin;
+ int junk_signed;
unsigned int junk;
- if (!XQueryPointer(dpy, c->win, &junkwin, &junkwin, &junk, &junk, &rx, &ry, &junk))
+ if (!XQueryPointer(dpy, c->win, &junkwin, &junkwin, &junk_signed, &junk_signed, &rx, &ry, &junk))
return;
-
int left = rx < orig_w / 3;
int right = rx > orig_w * 2 / 3;
int top = ry < orig_h / 3;
@@ -1582,7 +1587,8 @@ resizemouse(const Arg *arg)
selmon = m;
focus(NULL);
}
-#if ENCHANCED_TOGGLE_FLOATING && RESTORE_SIZE_AND_POS_ETF
+#if ENHANCED_TOGGLE_FLOATING && RESTORE_SIZE_AND_POS_ETF
+ c->wasmanuallyedited = 1;
if (c->isfloating) {
c->sfx = c->x;
c->sfy = c->y;
@@ -1653,7 +1659,8 @@ resizemouse(const Arg *arg)
selmon = m;
focus(NULL);
}
-#if ENCHANCED_TOGGLE_FLOATING && RESTORE_SIZE_AND_POS_ETF
+#if ENHANCED_TOGGLE_FLOATING && RESTORE_SIZE_AND_POS_ETF
+ c->wasmanuallyedited = 1;
if (c->isfloating) {
c->sfx = c->x;
c->sfy = c->y;
@@ -1826,7 +1833,8 @@ setlayout(const Arg *arg)
selmon->sellt ^= 1;
if (arg && arg->v)
selmon->lt[selmon->sellt] = (Layout *)arg->v;
- strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol);
+ strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol - 1);
+ selmon->ltsymbol[sizeof selmon->ltsymbol - 1] = '\0';
if (selmon->sel)
arrange(selmon);
else