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 11 months ago committed by GitHub
parent c4b393e944
commit d86acaf89f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

22
dwm.c

@ -2401,17 +2401,6 @@ killclient(const Arg *arg)
#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
@ -4471,6 +4460,17 @@ unmanage(Client *c, int destroyed)
focus(NULL);
updateclientlist();
arrange(m);
#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 SWITCHTAG_PATCH
if (switchtag && ((switchtag & TAGMASK) != selmon->tagset[selmon->seltags]))
view(&((Arg) { .ui = switchtag }));

Loading…
Cancel
Save