From 24d06241c2e2c2bd2f5bcac3d3e515ae82383e76 Mon Sep 17 00:00:00 2001 From: speediegq Date: Fri, 26 Aug 2022 19:04:54 +0200 Subject: [PATCH] Add clicktofocus back, we'll see if it crashes. If it does, we'll revert this commit. --- docs/example.Xresources | 1 + options.h | 2 +- speedwm.c | 4 ++-- xresources.h | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/example.Xresources b/docs/example.Xresources index 5c6530a..73f9323 100644 --- a/docs/example.Xresources +++ b/docs/example.Xresources @@ -51,6 +51,7 @@ - speedwm.mousemfact: 1 - speedwm.mfact: 0.50 - speedwm.startontag: 1 + - speedwm.clicktofocus: 0 - speedwm.enablegaps: 1 - speedwm.smartgaps: 0 - speedwm.smartgapsize: 0 diff --git a/options.h b/options.h index 392e253..9f2adf1 100644 --- a/options.h +++ b/options.h @@ -184,7 +184,7 @@ static char *scratchpadcmd[] = {"s", TERMINAL, "-t", "scratchpa static int warpcursor = 1; /* Warp cursor when switching client/monitor */ static int pertag = 1; /* Use different mfact and layout for each layout */ static int wmclass = 1; /* Enable (1) workaround for when a class cannot be grabbed */ -static int focusontouch = 1; /* Focus when the users' mouse touches a window (1) */ +static int clicktofocus = 0; /* Click to focus, or focus when the mouse moves to another window */ /* Full screen options */ static int movefullscreenmon = 1; /* Move fullscreen windows to another monitor */ diff --git a/speedwm.c b/speedwm.c index f4cda04..f256fc4 100644 --- a/speedwm.c +++ b/speedwm.c @@ -1773,6 +1773,7 @@ drawbars(void) void enternotify(XEvent *e) { + if (!clicktofocus) { Client *c; Monitor *m; XCrossingEvent *ev = &e->xcrossing; @@ -1786,7 +1787,6 @@ enternotify(XEvent *e) selmon = m; } else if (!c || c == selmon->sel) return; - if (focusontouch) { focus(c); } } @@ -3501,7 +3501,7 @@ restack(Monitor *m) XSync(dpy, False); while (XCheckMaskEvent(dpy, EnterWindowMask, &ev)); - if (warpcursor && focusontouch) + if (warpcursor) { if (m == selmon && (m->tagset[m->seltags] & m->sel->tags) && selmon->lt[selmon->sellt] != &layouts[2]) warp(m->sel); diff --git a/xresources.h b/xresources.h index cb741d7..8b82d1b 100644 --- a/xresources.h +++ b/xresources.h @@ -152,7 +152,7 @@ ResourcePref resources[] = { { "deckcount", INTEGER, &deckcount }, { "defaultlayout", INTEGER, &defaultlayout }, { "wmclass", INTEGER, &wmclass }, - { "focusontouch", INTEGER, &focusontouch }, + { "clicktofocus", INTEGER, &clicktofocus }, { "roundedcorners", INTEGER, &roundedcorners }, { "cornerradius", INTEGER, &cornerradius }, { "underline", INTEGER, &underline },