aboutsummaryrefslogtreecommitdiff
path: root/dwm.c
diff options
context:
space:
mode:
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c16
1 files changed, 12 insertions, 4 deletions
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();