summaryrefslogtreecommitdiff
path: root/dwm.c
diff options
context:
space:
mode:
authorProsperousPotato <ProsperousPotato@users.noreply.github.com>2025-08-15 19:23:44 +0100
committerProsperousPotato <ProsperousPotato@users.noreply.github.com>2025-08-15 19:23:44 +0100
commitbb66c2a6c1bec4bada52a5f4972d60b3148b6800 (patch)
treef98c605fd74987e60bc378c858059fdfa32684a6 /dwm.c
parentd011fc0158c6bfc5bd1cdc17573011cd0d14b4c0 (diff)
implement function to toggle mouse on & off
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/dwm.c b/dwm.c
index c0efdfa..bb5d242 100644
--- a/dwm.c
+++ b/dwm.c
@@ -234,6 +234,7 @@ static int xerror(Display *dpy, XErrorEvent *ee);
static int xerrordummy(Display *dpy, XErrorEvent *ee);
static int xerrorstart(Display *dpy, XErrorEvent *ee);
static void zoom(const Arg *arg);
+static void togglemouse(const Arg *arg);
static pid_t getparentprocess(pid_t p);
static int isdescprocess(pid_t p, pid_t c);
@@ -1553,6 +1554,12 @@ setup(void)
scheme = ecalloc(LENGTH(colors), sizeof(Clr *));
for (i = 0; i < LENGTH(colors); i++)
scheme[i] = drw_scm_create(drw, colors[i], 4);
+
+ /* init mouse */
+ if (mouse_default == 0) {
+ togglemouse(0);
+ }
+
/* supporting window for NetWMCheck */
wmcheckwin = XCreateSimpleWindow(dpy, root, 0, 0, 1, 1, 0, 0, 0);
XChangeProperty(dpy, wmcheckwin, netatom[NetWMCheck], XA_WINDOW, 32,
@@ -2210,6 +2217,8 @@ zoom(const Arg *arg)
if (c == nexttiled(selmon->clients) && !(c = nexttiled(c->next)))
return;
pop(c);
+
+ XWarpPointer(dpy, None, selmon->sel->win, 0, 0, 0, 0, selmon->sel->w/2, selmon->sel->h/2);
}
int