Update dwm.c

It modifies the default behavior of dwm so that when a client is killed, the previously focused client is no longer selected/focused. Instead, the focus now dynamically follows the mouse cursor.
pull/364/head
Random Guy 12 months ago committed by GitHub
parent e2dbcadc02
commit 6aeca56a22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

12
dwm.c

@ -2400,6 +2400,18 @@ killclient(const Arg *arg)
force_warp = 1;
#endif // WARP_PATCH
}
#if FOCUS_FOLLOW_MOUSE_ON_KILL_PATCH
Window child;
int rootx, rooty, winx, winy;
unsigned int mask;
XQueryPointer(dpy, root, &root, &child, &rootx, &rooty, &winx, &winy, &mask);
Client *c = wintoclient(child);
if (c)
focus(c);
#endif //FOCUS_FOLLOW_MOUSE_ON_KILL_PATCH
#if SWAPFOCUS_PATCH && PERTAG_PATCH
selmon->pertag->prevclient[selmon->pertag->curtag] = NULL;
#endif // SWAPFOCUS_PATCH

Loading…
Cancel
Save