[wiki] [sites] [dwm][patches][noborderflicker] Handle when lastfocused == c || Chris Down

From: <git_AT_suckless.org>
Date: Fri, 31 Dec 2021 01:08:02 +0100

commit 131bf5fe9e1dd6697fdb26037ade243d2ff72d9f
Author: Chris Down <chris_AT_chrisdown.name>
Date: Fri Dec 31 00:07:51 2021 +0000

    [dwm][patches][noborderflicker] Handle when lastfocused == c

diff --git a/dwm.suckless.org/patches/noborderflicker/dwm-noborderflicker-20211227-8657affa2a61.diff b/dwm.suckless.org/patches/noborderflicker/dwm-noborderflicker-20211227-8657affa2a61.diff
index 9f3bb9b1..c4369f2c 100644
--- a/dwm.suckless.org/patches/noborderflicker/dwm-noborderflicker-20211227-8657affa2a61.diff
+++ b/dwm.suckless.org/patches/noborderflicker/dwm-noborderflicker-20211227-8657affa2a61.diff
_AT_@ -1,5 +1,5 @@
 diff --git dwm.c dwm.c
-index a96f33c..50ccf00 100644
+index a96f33c..3fd4a88 100644
 --- dwm.c
 +++ dwm.c
 _AT_@ -236,6 +236,7 @@ static int xerrorstart(Display *dpy, XErrorEvent *ee);
_AT_@ -10,18 +10,19 @@ index a96f33c..50ccf00 100644
  static const char broken[] = "broken";
  static char stext[256];
  static int screen;
-_AT_@ -799,7 +800,10 @@ focus(Client *c)
+_AT_@ -799,7 +800,11 @@ focus(Client *c)
                  detachstack(c);
                  attachstack(c);
                  grabbuttons(c, 1);
 + /* set new focused border first to avoid flickering */
                  XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColBorder].pixel);
-+ if (lastfocused)
++ /* lastfocused may be us if another window was unmanaged */
++ if (lastfocused != c)
 + XSetWindowBorder(dpy, lastfocused->win, scheme[SchemeNorm][ColBorder].pixel);
                  setfocus(c);
          } else {
                  XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
-_AT_@ -1758,7 +1762,7 @@ unfocus(Client *c, int setfocus)
+_AT_@ -1758,7 +1763,7 @@ unfocus(Client *c, int setfocus)
          if (!c)
                  return;
          grabbuttons(c, 0);
_AT_@ -30,7 +31,7 @@ index a96f33c..50ccf00 100644
          if (setfocus) {
                  XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
                  XDeleteProperty(dpy, root, netatom[NetActiveWindow]);
-_AT_@ -1784,6 +1788,8 @@ unmanage(Client *c, int destroyed)
+_AT_@ -1784,6 +1789,8 @@ unmanage(Client *c, int destroyed)
                  XSetErrorHandler(xerror);
                  XUngrabServer(dpy);
          }
Received on Fri Dec 31 2021 - 01:08:02 CET

This archive was generated by hypermail 2.3.0 : Fri Dec 31 2021 - 01:12:45 CET