|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
From 979a7c2d77f7284247c025d9657d5ff4b4972236 Mon Sep 17 00:00:00 2001
|
|
|
|
|
From 4637d9b0d4a4e4ecd5560037247923c620f12973 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 | 183 ++++++++++++++++++++++++++++++++++++++++-----------
|
|
|
|
|
2 files changed, 148 insertions(+), 39 deletions(-)
|
|
|
|
|
dwm.c | 181 ++++++++++++++++++++++++++++++++++++++++-----------
|
|
|
|
|
2 files changed, 147 insertions(+), 38 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..57f46eb 100644
|
|
|
|
|
index 4465af1..74307ad 100644
|
|
|
|
|
--- a/dwm.c
|
|
|
|
|
+++ b/dwm.c
|
|
|
|
|
@@ -93,6 +93,7 @@ struct Client {
|
|
|
|
@ -186,24 +186,7 @@ index 4465af1..57f46eb 100644
|
|
|
|
|
return;
|
|
|
|
|
restack(selmon);
|
|
|
|
|
ocx = c->x;
|
|
|
|
|
@@ -1284,7 +1295,15 @@ resizeclient(Client *c, int x, int y, int w, int h)
|
|
|
|
|
wc.border_width = c->bw;
|
|
|
|
|
XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc);
|
|
|
|
|
configure(c);
|
|
|
|
|
- XSync(dpy, False);
|
|
|
|
|
+ if (c->fakefullscreen == 1)
|
|
|
|
|
+ /* Exception: if the client was in actual fullscreen and we exit out to fake fullscreen
|
|
|
|
|
+ * mode, then the focus would drift to whichever window is under the mouse cursor at the
|
|
|
|
|
+ * time. To avoid this we pass True to XSync which will make the X server disregard any
|
|
|
|
|
+ * other events in the queue thus cancelling the EnterNotify event that would otherwise
|
|
|
|
|
+ * have changed focus. */
|
|
|
|
|
+ XSync(dpy, True);
|
|
|
|
|
+ else
|
|
|
|
|
+ XSync(dpy, False);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
@@ -1298,7 +1317,7 @@ resizemouse(const Arg *arg)
|
|
|
|
|
@@ -1298,7 +1309,7 @@ resizemouse(const Arg *arg)
|
|
|
|
|
|
|
|
|
|
if (!(c = selmon->sel))
|
|
|
|
|
return;
|
|
|
|
@ -212,7 +195,7 @@ index 4465af1..57f46eb 100644
|
|
|
|
|
return;
|
|
|
|
|
restack(selmon);
|
|
|
|
|
ocx = c->x;
|
|
|
|
|
@@ -1412,7 +1431,7 @@ sendmon(Client *c, Monitor *m)
|
|
|
|
|
@@ -1412,7 +1423,7 @@ sendmon(Client *c, Monitor *m)
|
|
|
|
|
{
|
|
|
|
|
if (c->mon == m)
|
|
|
|
|
return;
|
|
|
|
@ -221,13 +204,14 @@ index 4465af1..57f46eb 100644
|
|
|
|
|
detach(c);
|
|
|
|
|
detachstack(c);
|
|
|
|
|
c->mon = m;
|
|
|
|
|
@@ -1472,29 +1491,71 @@ setfocus(Client *c)
|
|
|
|
|
@@ -1472,29 +1483,79 @@ 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);
|
|
|
|
|
+ XEvent ev;
|
|
|
|
|
+ int savestate = 0, restorestate = 0, restorefakefullscreen = 0;
|
|
|
|
|
+
|
|
|
|
|
+ if ((c->fakefullscreen == 0 && fullscreen && !c->isfullscreen) // normal fullscreen
|
|
|
|
@ -305,6 +289,13 @@ index 4465af1..57f46eb 100644
|
|
|
|
|
resizeclient(c, c->x, c->y, c->w, c->h);
|
|
|
|
|
- arrange(c->mon);
|
|
|
|
|
- }
|
|
|
|
|
+
|
|
|
|
|
+ /* Exception: if the client was in actual fullscreen and we exit out to fake fullscreen
|
|
|
|
|
+ * mode, then the focus would sometimes drift to whichever window is under the mouse cursor
|
|
|
|
|
+ * at the time. To avoid this we ask X for all EnterNotify events and just ignore them.
|
|
|
|
|
+ */
|
|
|
|
|
+ if (!c->isfullscreen)
|
|
|
|
|
+ while (XCheckMaskEvent(dpy, EnterWindowMask, &ev));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|