myvxwm

[fork] my vxwm config (optimised for my T480)
git clone https://git.lukeonline.net/repos/myvxwm
Log | Files | Refs | README | LICENSE

commit 8cccd889a1b64508373f151779388147a5194151
parent 25547c950cdc7230ce914782b4b382d4bf015345
Author: wh1tepearl <wh1tepearl@gmail.com>
Date:   Thu,  2 Apr 2026 19:27:47 +0100

move ALWAYS_CENTER_NEW_FLOATING_WINDOWS to config.h and add NEW_FLOATING_WINDOWS_APPEAR_UNDER_CURSOR

Diffstat:
Mconfig.def.h | 3+++
Mmodules.def.h | 2--
Mvxwm.c | 11++++++++++-
3 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/config.def.h b/config.def.h @@ -22,6 +22,9 @@ static MAYBE_CONST char *colors[][3] = { [SchemeSel] = { selfgcolor, selbgcolor, selbordercolor }, }; +#define CENTER_NEW_FLOATING_WINDOWS 1 // so, basically, it does what it says. (make 0 to turn off) +#define NEW_FLOATING_WINDOWS_APPEAR_UNDER_CURSOR 0 // so, basically, it does what it says. (make 0 to turn off) + #if GAPS static const unsigned int gappx = 5; #endif diff --git a/modules.def.h b/modules.def.h @@ -104,8 +104,6 @@ Even though this sounds complex, it is actually pretty lightweight, and is very /* Floating */ /* Recomended to use with ALWAYS_CENTER_NEW_FLOATING_WINDOWS set to 1. */ -#define ALWAYS_CENTER_NEW_FLOATING_WINDOWS 1 // so, basically, it does what it says. - #define FLOATING_LAYOUT_FLOATS_WINDOWS 1 /* 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 diff --git a/vxwm.c b/vxwm.c @@ -1290,10 +1290,19 @@ manage(Window w, XWindowAttributes *wa) updatewindowtype(c); updatesizehints(c); updatewmhints(c); -#if ALWAYS_CENTER_NEW_FLOATING_WINDOWS +#if CENTER_NEW_FLOATING_WINDOWS && !NEW_WINDOWS_APPEAR_UNDER_CURSOR c->x = c->mon->wx + (c->mon->ww - WIDTH(c)) / 2; c->y = c->mon->wy + (c->mon->wh - HEIGHT(c)) / 2; #endif +#if NEW_FLOATING_WINDOWS_APPEAR_UNDER_CURSOR + int mx, my, di; + unsigned int dui; + Window dw; + XQueryPointer(dpy, root, &dw, &dw, &mx, &my, &di, &di, &dui); + + c->x = mx - c->w / 2; + c->y = my - c->h / 2; +#endif XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask); grabbuttons(c, 0); if (!c->isfloating)