fullscreen compilation: addressed obscure bug that could result in a fullscreen fake fullscreen window

pull/19/head
bakkeby 4 years ago
parent 8734ee7e37
commit fa7fa64044

@ -1,4 +1,4 @@
From b50a85db1f4f6208042c433c5c702f0f18569d13 Mon Sep 17 00:00:00 2001
From e55e96a618298576aadd090cab52d84e26ad44cd Mon Sep 17 00:00:00 2001
From: bakkeby <bakkeby@gmail.com>
Date: Sat, 5 Sep 2020 14:32:26 +0200
Subject: [PATCH] Compilation of fullscreen patches for dwm.
@ -26,8 +26,8 @@ This incorporates, and expands on, the following patches:
- losefullscreen
---
config.def.h | 4 +-
dwm.c | 164 ++++++++++++++++++++++++++++++++++++++++-----------
2 files changed, 134 insertions(+), 34 deletions(-)
dwm.c | 165 ++++++++++++++++++++++++++++++++++++++++-----------
2 files changed, 135 insertions(+), 34 deletions(-)
diff --git a/config.def.h b/config.def.h
index 1c0b587..5f28f2c 100644
@ -48,7 +48,7 @@ index 1c0b587..5f28f2c 100644
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
{ MODKEY, XK_comma, focusmon, {.i = -1 } },
diff --git a/dwm.c b/dwm.c
index 4465af1..5352547 100644
index 4465af1..6a908c6 100644
--- a/dwm.c
+++ b/dwm.c
@@ -93,6 +93,7 @@ struct Client {
@ -221,14 +221,14 @@ index 4465af1..5352547 100644
detach(c);
detachstack(c);
c->mon = m;
@@ -1472,28 +1491,61 @@ setfocus(Client *c)
@@ -1472,28 +1491,62 @@ setfocus(Client *c)
void
setfullscreen(Client *c, int fullscreen)
{
- if (fullscreen && !c->isfullscreen) {
- XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32,
- PropModeReplace, (unsigned char*)&netatom[NetWMFullscreen], 1);
+ int savestate = 0, restorestate = 0;
+ int savestate = 0, restorestate = 0, restorefakefullscreen = 0;
+
+ if ((c->fakefullscreen == 0 && fullscreen && !c->isfullscreen) // normal fullscreen
+ || (c->fakefullscreen == 2 && fullscreen)) // fake fullscreen --> actual fullscreen
@ -243,12 +243,11 @@ index 4465af1..5352547 100644
+ * while keeping fake fullscreen enabled (as otherwise there will be a mismatch between the
+ * client and the window manager's perception of the client's fullscreen state). */
+ if (c->fakefullscreen == 2 && !fullscreen && c->isfullscreen) {
+ c->fakefullscreen = 1;
+ restorefakefullscreen = 1;
c->isfullscreen = 1;
- c->oldstate = c->isfloating;
+ fullscreen = 1;
+ } else if (c->fakefullscreen == 3) // client exiting actual fullscreen
+ c->fakefullscreen = 1;
+ }
+
+ if (fullscreen != c->isfullscreen) { // only send property change if necessary
+ if (fullscreen)
@ -287,13 +286,15 @@ index 4465af1..5352547 100644
c->y = c->oldy;
c->w = c->oldw;
c->h = c->oldh;
+ if (restorefakefullscreen || c->fakefullscreen == 3)
+ c->fakefullscreen = 1;
resizeclient(c, c->x, c->y, c->w, c->h);
- arrange(c->mon);
+ restack(c->mon);
}
}
@@ -1665,9 +1717,19 @@ tag(const Arg *arg)
@@ -1665,9 +1718,19 @@ tag(const Arg *arg)
void
tagmon(const Arg *arg)
{
@ -315,7 +316,7 @@ index 4465af1..5352547 100644
}
void
@@ -1705,18 +1767,51 @@ togglebar(const Arg *arg)
@@ -1705,18 +1768,51 @@ togglebar(const Arg *arg)
arrange(selmon);
}
@ -373,7 +374,7 @@ index 4465af1..5352547 100644
}
void
@@ -1747,10 +1842,13 @@ toggleview(const Arg *arg)
@@ -1747,10 +1843,13 @@ toggleview(const Arg *arg)
}
void

Loading…
Cancel
Save