diff options
author | xAlpharax <42233094+xAlpharax@users.noreply.github.com> | 2023-08-17 03:53:33 +0300 |
---|---|---|
committer | xAlpharax <42233094+xAlpharax@users.noreply.github.com> | 2023-08-17 03:53:33 +0300 |
commit | 67f972f7426503cd4307ffe53868453d19777efa (patch) | |
tree | 1e18b7dd3b72f2b2ce2ff6a89a63cc54cde87010 /patches/dwm-noborderflicker-20211227-8657affa2a61.diff | |
parent | 1ba93142d274f83b57e8c3f2bb474584f96e259f (diff) |
Patched sticky, noborderflicker and resizecorners into master.
PS: The new keybinds will be added after the huge patches.
Changes to be committed:
modified: dwm.c
modified: dwm.c.orig
renamed: patches_new/dwm-noborderflicker-20211227-8657affa2a61.diff -> patches/dwm-noborderflicker-20211227-8657affa2a61.diff
renamed: patches_new/dwm-resizecorners-6.2.diff -> patches/dwm-resizecorners-6.2.diff
renamed: patches_new/dwm-sticky-6.4.diff -> patches/dwm-sticky-6.4.diff
Diffstat (limited to 'patches/dwm-noborderflicker-20211227-8657affa2a61.diff')
-rw-r--r-- | patches/dwm-noborderflicker-20211227-8657affa2a61.diff | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/patches/dwm-noborderflicker-20211227-8657affa2a61.diff b/patches/dwm-noborderflicker-20211227-8657affa2a61.diff new file mode 100644 index 0000000..df2aeb3 --- /dev/null +++ b/patches/dwm-noborderflicker-20211227-8657affa2a61.diff @@ -0,0 +1,42 @@ +diff --git dwm.c dwm.c +index a96f33c..34d1321 100644 +--- dwm.c ++++ dwm.c +@@ -236,6 +236,7 @@ static int xerrorstart(Display *dpy, XErrorEvent *ee); + static void zoom(const Arg *arg); + + /* variables */ ++static Client *lastfocused = NULL; + static const char broken[] = "broken"; + static char stext[256]; + static int screen; +@@ -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); ++ /* lastfocused may be us if another window was unmanaged */ ++ if (lastfocused && lastfocused != c) ++ XSetWindowBorder(dpy, lastfocused->win, scheme[SchemeNorm][ColBorder].pixel); + setfocus(c); + } else { + XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); +@@ -1758,7 +1763,7 @@ unfocus(Client *c, int setfocus) + if (!c) + return; + grabbuttons(c, 0); +- XSetWindowBorder(dpy, c->win, scheme[SchemeNorm][ColBorder].pixel); ++ lastfocused = c; + if (setfocus) { + XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); + XDeleteProperty(dpy, root, netatom[NetActiveWindow]); +@@ -1784,6 +1789,8 @@ unmanage(Client *c, int destroyed) + XSetErrorHandler(xerror); + XUngrabServer(dpy); + } ++ if (lastfocused == c) ++ lastfocused = NULL; + free(c); + focus(NULL); + updateclientlist(); |