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
This commit is contained in:
bakkeby
2020-10-06 08:45:17 +02:00
parent c47f61387d
commit 56c81ddbfa
5 changed files with 50 additions and 16 deletions

12
dwm.c
View File

@@ -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;