From 05e2bf7b62eb9fe04d104d4a87dbe61c85546b43 Mon Sep 17 00:00:00 2001 From: c Date: Fri, 12 Jan 2024 09:06:19 -0500 Subject: I'm sure it was something important. --- dwm.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'dwm.c') diff --git a/dwm.c b/dwm.c index 5a66327..220a5f3 100644 --- a/dwm.c +++ b/dwm.c @@ -218,6 +218,7 @@ static void monocle(Monitor *m); static void motionnotify(XEvent *e); static void movemouse(const Arg *arg); static void moveresize(const Arg *arg); +static void movecenter(const Arg * arg); static Client *nexttiled(Client *c); static void pop(Client *c); static void propertynotify(XEvent *e); @@ -1335,6 +1336,14 @@ movemouse(const Arg *arg) } } +void +movecenter(const Arg *arg) +{ + selmon->sel->x = selmon->sel->mon->mx + (selmon->sel->mon->mw - WIDTH(selmon->sel)) / 2; + selmon->sel->y = selmon->sel->mon->my + (selmon->sel->mon->mh - HEIGHT(selmon->sel)) / 2; + arrange(selmon); +} + Client * nexttiled(Client *c) { @@ -1488,7 +1497,6 @@ resizemouse(const Arg *arg) break; } } while (ev.type != ButtonRelease); - XUngrabPointer(dpy, CurrentTime); while (XCheckMaskEvent(dpy, EnterWindowMask, &ev)); if ((m = recttomon(c->x, c->y, c->w, c->h)) != selmon) { @@ -1724,7 +1732,7 @@ setup(void) die("no fonts could be loaded."); lrpad = drw->font->h; bh = drw->font->h + 2; - sp = sidepad; + sp = sidepad; vp = (topbar == 1) ? vertpad : - vertpad; updategeom(); /* init atoms */ @@ -2515,7 +2523,7 @@ int main(int argc, char *argv[]) { if (argc == 2 && !strcmp("-v", argv[1])) - die("dwm-"VERSION); + die( "dwm-" VERSION ); else if (argc != 1) die("usage: dwm [-v]"); if (!setlocale(LC_CTYPE, "") || !XSupportsLocale()) @@ -2529,7 +2537,7 @@ main(int argc, char *argv[]) load_xresources(); setup(); #ifdef __OpenBSD__ -+ if (pledge("stdio rpath proc exec ps", NULL) == -1) + if (pledge("stdio rpath proc exec ps", NULL) == -1) die("pledge"); #endif /* __OpenBSD__ */ scan(); -- cgit v1.2.3