From 56c81ddbfa8f133d6690977f6ea01d16185538a2 Mon Sep 17 00:00:00 2001 From: bakkeby Date: Tue, 6 Oct 2020 08:45:17 +0200 Subject: warp: dragmfact + dragcfact compatibility These set of changes introduce: a) a flag to ignore warp from happening while dragmfact or dragcfact is being used and b) a flag to force warp when killclient or showhideclient is used, to make for a more intuitive experience ref. https://github.com/bakkeby/patches/issues/11 --- dwm.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'dwm.c') diff --git a/dwm.c b/dwm.c index 724fe64..8717d01 100644 --- a/dwm.c +++ b/dwm.c @@ -671,6 +671,10 @@ static int lrpad; /* sum of left and right padding for text */ * when moving (or resizing) client windows from one monitor to another. This variable is used * internally to ignore such configure requests while movemouse or resizemouse are being used. */ static int ignoreconfigurerequests = 0; +#if WARP_PATCH +static int force_warp = 0; // force warp in some situations, e.g. killclient +static int ignore_warp = 0; // force skip warp in some situations, e.g. dragmfact, dragcfact +#endif // WARP_PATCH static int (*xerrorxlib)(Display *, XErrorEvent *); static unsigned int numlockmask = 0; static void (*handler[LASTEvent]) (XEvent *) = { @@ -2112,10 +2116,11 @@ killclient(const Arg *arg) #endif // ISPERMANENT_PATCH return; #if BAR_SYSTRAY_PATCH - if (!sendevent(selmon->sel->win, wmatom[WMDelete], NoEventMask, wmatom[WMDelete], CurrentTime, 0, 0, 0)) { + if (!sendevent(selmon->sel->win, wmatom[WMDelete], NoEventMask, wmatom[WMDelete], CurrentTime, 0, 0, 0)) #else - if (!sendevent(selmon->sel, wmatom[WMDelete])) { + if (!sendevent(selmon->sel, wmatom[WMDelete])) #endif // BAR_SYSTRAY_PATCH + { XGrabServer(dpy); XSetErrorHandler(xerrordummy); XSetCloseDownMode(dpy, DestroyAll); @@ -2123,6 +2128,9 @@ killclient(const Arg *arg) XSync(dpy, False); XSetErrorHandler(xerror); XUngrabServer(dpy); + #if WARP_PATCH + force_warp = 1; + #endif // WARP_PATCH } #if SWAPFOCUS_PATCH && PERTAG_PATCH selmon->pertag->prevclient[selmon->pertag->curtag] = NULL; -- cgit v1.2.3