summaryrefslogtreecommitdiffhomepage
path: root/patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch')
-rw-r--r--patch/tagallmon.c31
-rw-r--r--patch/tagswapmon.c28
-rw-r--r--patch/togglefullscreen.c31
3 files changed, 64 insertions, 26 deletions
diff --git a/patch/tagallmon.c b/patch/tagallmon.c
index 51af142..f863b6d 100644
--- a/patch/tagallmon.c
+++ b/patch/tagallmon.c
@@ -2,27 +2,44 @@ void
tagallmon(const Arg *arg)
{
Monitor *m;
- Client *c;
- Client *next;
+ Client *c, *last, *slast, *next;
if (!mons->next)
return;
m = dirtomon(arg->i);
+ for (last = m->clients; last && last->next; last = last->next);
+ for (slast = m->stack; slast && slast->snext; slast = slast->snext);
+
for (c = selmon->clients; c; c = next) {
next = c->next;
if (!ISVISIBLE(c))
continue;
- unfocus(c, 1);
+ unfocus(c, 1, NULL);
detach(c);
detachstack(c);
c->mon = m;
c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */
- attach(c);
- attachstack(c);
+ c->next = NULL;
+ c->snext = NULL;
+ if (last)
+ last = last->next = c;
+ else
+ m->clients = last = c;
+ if (slast)
+ slast = slast->snext = c;
+ else
+ m->stack = slast = c;
if (c->isfullscreen) {
- setfullscreen(c, 0);
- setfullscreen(c, 1);
+ #if !FAKEFULLSCREEN_PATCH && FAKEFULLSCREEN_CLIENT_PATCH
+ if (c->fakefullscreen != 1) {
+ resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh);
+ XRaiseWindow(dpy, c->win);
+ }
+ #elif !FAKEFULLSCREEN_PATCH
+ resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh);
+ XRaiseWindow(dpy, c->win);
+ #endif // FAKEFULLSCREEN_CLIENT_PATCH
}
}
diff --git a/patch/tagswapmon.c b/patch/tagswapmon.c
index 8779262..e25552f 100644
--- a/patch/tagswapmon.c
+++ b/patch/tagswapmon.c
@@ -13,7 +13,7 @@ tagswapmon(const Arg *arg)
next = c->next;
if (!ISVISIBLE(c))
continue;
- unfocus(c, 1);
+ unfocus(c, 1, NULL);
detach(c);
detachstack(c);
c->next = sc;
@@ -24,7 +24,7 @@ tagswapmon(const Arg *arg)
next = c->next;
if (!ISVISIBLE(c))
continue;
- unfocus(c, 1);
+ unfocus(c, 1, NULL);
detach(c);
detachstack(c);
c->next = mc;
@@ -38,20 +38,34 @@ tagswapmon(const Arg *arg)
attach(c);
attachstack(c);
if (c->isfullscreen) {
- setfullscreen(c, 0);
- setfullscreen(c, 1);
+ #if !FAKEFULLSCREEN_PATCH && FAKEFULLSCREEN_CLIENT_PATCH
+ if (c->fakefullscreen != 1) {
+ resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh);
+ XRaiseWindow(dpy, c->win);
+ }
+ #elif !FAKEFULLSCREEN_PATCH
+ resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh);
+ XRaiseWindow(dpy, c->win);
+ #endif // FAKEFULLSCREEN_CLIENT_PATCH
}
}
for (c = mc; c; c = next) {
- next = c->next;
+ next = ;
c->mon = selmon;
c->tags = selmon->tagset[selmon->seltags]; /* assign tags of target monitor */
attach(c);
attachstack(c);
if (c->isfullscreen) {
- setfullscreen(c, 0);
- setfullscreen(c, 1);
+ #if !FAKEFULLSCREEN_PATCH && FAKEFULLSCREEN_CLIENT_PATCH
+ if (c->fakefullscreen != 1) {
+ resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh);
+ XRaiseWindow(dpy, c->win);
+ }
+ #elif !FAKEFULLSCREEN_PATCH
+ resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh);
+ XRaiseWindow(dpy, c->win);
+ #endif // FAKEFULLSCREEN_CLIENT_PATCH
}
}
diff --git a/patch/togglefullscreen.c b/patch/togglefullscreen.c
index 0d08e72..02de033 100644
--- a/patch/togglefullscreen.c
+++ b/patch/togglefullscreen.c
@@ -1,17 +1,24 @@
void
togglefullscreen(const Arg *arg)
{
- if (!selmon->sel)
- return;
+ if (!selmon->sel)
+ return;
- #if !FAKEFULLSCREEN_PATCH && FAKEFULLSCREEN_CLIENT_PATCH
- if (selmon->sel->fakefullscreen) {
- selmon->sel->fakefullscreen = 0;
- if (selmon->sel->isfullscreen) {
- selmon->sel->isfullscreen = 0;
- }
- }
- #endif // FAKEFULLSCREEN_CLIENT_PATCH
+ #if !FAKEFULLSCREEN_PATCH && FAKEFULLSCREEN_CLIENT_PATCH
+ if (selmon->sel->fakefullscreen == 1) {
+ selmon->sel->fakefullscreen = 2;
+ if (selmon->sel->isfullscreen) {
+ selmon->sel->isfullscreen = 0;
+ }
+ } else if (selmon->sel->fakefullscreen == 2) {
+ selmon->sel->fakefullscreen = 0;
+ togglefakefullscreen(NULL);
+ arrange(selmon);
+ return;
+ }
+ #endif // FAKEFULLSCREEN_CLIENT_PATCH
- setfullscreen(selmon->sel, !selmon->sel->isfullscreen);
-} \ No newline at end of file
+ setfullscreen(selmon->sel, !selmon->sel->isfullscreen);
+ if (!selmon->sel->isfullscreen)
+ arrange(selmon);
+}