--
Best Regards,
Tom Schwindl
diff --git a/dwm.c b/dwm.c
index 253aba7b6f7d..c5dd6db5c84c 100644
--- a/dwm.c
+++ b/dwm.c
_AT_@ -207,6 +207,7 @@ static void seturgent(Client *c, int urg);
static void showhide(Client *c);
static void sigchld(int unused);
static void spawn(const Arg *arg);
+static void swapfocus(const Arg *arg);
static void tag(const Arg *arg);
static void tagmon(const Arg *arg);
static void tile(Monitor *m);
_AT_@ -236,6 +237,7 @@ static int xerrorstart(Display *dpy, XErrorEvent *ee);
static void zoom(const Arg *arg);
/* variables */
+static Client *prevclient;
static const char broken[] = "broken";
static char stext[256];
static int screen;
_AT_@ -1650,6 +1652,22 @@ spawn(const Arg *arg)
}
}
+void
+swapfocus(const Arg *arg)
+{
+ Client *c;
+ Arg tmp;
+
+ for (c = selmon->clients; c && c != prevclient; c = c->next)
+ ;
+ if (c == prevclient) {
+ tmp.ui = (prevclient->tags & TAGMASK);
+ view(&tmp);
+ focus(prevclient);
+ restack(prevclient->mon);
+ }
+}
+
void
tag(const Arg *arg)
{
_AT_@ -1751,6 +1769,7 @@ unfocus(Client *c, int setfocus)
{
if (!c)
return;
+ prevclient = c;
grabbuttons(c, 0);
XSetWindowBorder(dpy, c->win, scheme[SchemeNorm][ColBorder].pixel);
if (setfocus) {
_AT_@ -2116,10 +2135,11 @@ void
zoom(const Arg *arg)
{
Client *c = selmon->sel;
+ prevclient = nexttiled(selmon->clients);
if (!selmon->lt[selmon->sellt]->arrange || !c || c->isfloating)
return;
- if (c == nexttiled(selmon->clients) && !(c = nexttiled(c->next)))
+ if (c == nexttiled(selmon->clients) && !(c = prevclient = nexttiled(c->next)))
return;
pop(c);
}
Received on Fri Nov 11 2022 - 14:41:55 CET
This archive was generated by hypermail 2.3.0 : Fri Nov 11 2022 - 14:48:09 CET