Adding fakefullscreeenclient patch

pull/32/head
bakkeby 5 years ago
parent 5fa724da0d
commit 9b85650c1d

@ -15,6 +15,8 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
### Changelog:
2019-11-21 - Added fakefullscreenclient patch
2019-10-24 - Added dragmfact, extrabar, exresize and nodmenu patches
2019-10-22 - Added ispermanent and swallow patches
@ -140,6 +142,11 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
- only allow clients to "fullscreen" into the space currently given to them
- as an example, this will allow you to view a fullscreen video in your browser on one half of the screen, while having the other half available for other tasks
- fakefullscreenclient
- similarly to the fakefullscreen patch this patch only allows clients to "fullscreen" into the space currently given to them
- as an example, this will allow you to view a fullscreen video in your browser on one half of the screen, while having the other half available for other tasks
- the "twist" with this patch is that fake fullscreen can be toggled on a per client basis rather than applying to all clients globally
- [fancybar](https://dwm.suckless.org/patches/fancybar/)
- shows the titles of all visible windows in the status bar

@ -614,6 +614,9 @@ static Key keys[] = {
#if TOGGLEFULLSCREEN_PATCH
{ MODKEY, XK_y, togglefullscreen, {0} },
#endif // TOGGLEFULLSCREEN_PATCH
#if FAKEFULLSCREEN_CLIENT_PATCH
{ MODKEY|ShiftMask, XK_y, togglefakefullscreen, {0} },
#endif // FAKEFULLSCREEN_CLIENT_PATCH
#if FULLSCREEN_PATCH
{ MODKEY|ShiftMask, XK_f, fullscreen, {0} },
#endif // FULLSCREEN_PATCH

39
dwm.c

@ -150,6 +150,9 @@ struct Client {
int bw, oldbw;
unsigned int tags;
int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen;
#if FAKEFULLSCREEN_CLIENT_PATCH
int fakefullscreen;
#endif // FAKEFULLSCREEN_CLIENT_PATCH
#if EXRESIZE_PATCH
unsigned char expandmask;
int expandx1, expandy1, expandx2, expandy2;
@ -1034,7 +1037,11 @@ configurenotify(XEvent *e)
for (m = mons; m; m = m->next) {
#if !FAKEFULLSCREEN_PATCH
for (c = m->clients; c; c = c->next)
#if FAKEFULLSCREEN_CLIENT_PATCH
if (c->isfullscreen && !c->fakefullscreen)
#else
if (c->isfullscreen)
#endif // FAKEFULLSCREEN_CLIENT_PATCH
resizeclient(c, m->mx, m->my, m->mw, m->mh);
#endif // !FAKEFULLSCREEN_PATCH
XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, m->ww, bh);
@ -1668,8 +1675,13 @@ focus(Client *c)
#if LOSEFULLSCREEN_PATCH
Client *at;
for (at = selmon->clients; at; at = at->next)
#if FAKEFULLSCREEN_CLIENT_PATCH
if (at != c && at->isfullscreen && !at->fakefullscreen && ISVISIBLE(at))
setfullscreen(at, 0);
#else
if (at != c && at->isfullscreen && ISVISIBLE(at))
setfullscreen(at, 0);
#endif // FAKEFULLSCREEN_CLIENT_PATCH
#endif // LOSEFULLSCREEN_PATCH
drawbars();
}
@ -2119,8 +2131,13 @@ movemouse(const Arg *arg)
if (!(c = selmon->sel))
return;
#if !FAKEFULLSCREEN_PATCH
#if FAKEFULLSCREEN_CLIENT_PATCH
if (c->isfullscreen && !c->fakefullscreen) /* no support moving fullscreen windows by mouse */
return;
#else
if (c->isfullscreen) /* no support moving fullscreen windows by mouse */
return;
#endif // FAKEFULLSCREEN_CLIENT_PATCH
#endif // FAKEFULLSCREEN_PATCH
restack(selmon);
ocx = c->x;
@ -2353,8 +2370,13 @@ resizemouse(const Arg *arg)
if (!(c = selmon->sel))
return;
#if !FAKEFULLSCREEN_PATCH
#if FAKEFULLSCREEN_CLIENT_PATCH
if (c->isfullscreen && !c->fakefullscreen) /* no support resizing fullscreen windows by mouse */
return;
#else
if (c->isfullscreen) /* no support resizing fullscreen windows by mouse */
return;
#endif // FAKEFULLSCREEN_CLIENT_PATCH
#endif // !FAKEFULLSCREEN_PATCH
restack(selmon);
ocx = c->x;
@ -2677,18 +2699,27 @@ setfullscreen(Client *c, int fullscreen)
PropModeReplace, (unsigned char*)&netatom[NetWMFullscreen], 1);
c->isfullscreen = 1;
#if !FAKEFULLSCREEN_PATCH
#if FAKEFULLSCREEN_CLIENT_PATCH
if (!c->fakefullscreen) {
#endif // FAKEFULLSCREEN_CLIENT_PATCH
c->oldstate = c->isfloating;
c->oldbw = c->bw;
c->bw = 0;
c->isfloating = 1;
resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh);
XRaiseWindow(dpy, c->win);
#if FAKEFULLSCREEN_CLIENT_PATCH
}
#endif // FAKEFULLSCREEN_CLIENT_PATCH
#endif // !FAKEFULLSCREEN_PATCH
} else if (!fullscreen && c->isfullscreen){
XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32,
PropModeReplace, (unsigned char*)0, 0);
c->isfullscreen = 0;
#if !FAKEFULLSCREEN_PATCH
#if FAKEFULLSCREEN_CLIENT_PATCH
if (!c->fakefullscreen) {
#endif // FAKEFULLSCREEN_CLIENT_PATCH
c->isfloating = c->oldstate;
c->bw = c->oldbw;
c->x = c->oldx;
@ -2697,6 +2728,9 @@ setfullscreen(Client *c, int fullscreen)
c->h = c->oldh;
resizeclient(c, c->x, c->y, c->w, c->h);
arrange(c->mon);
#if FAKEFULLSCREEN_CLIENT_PATCH
}
#endif // FAKEFULLSCREEN_CLIENT_PATCH
#endif // !FAKEFULLSCREEN_PATCH
}
}
@ -3083,8 +3117,13 @@ togglefloating(const Arg *arg)
if (!selmon->sel)
return;
#if !FAKEFULLSCREEN_PATCH
#if FAKEFULLSCREEN_CLIENT_PATCH
if (selmon->sel->isfullscreen && !selmon->sel->fakefullscreen) /* no support for fullscreen windows */
return;
#else
if (selmon->sel->isfullscreen) /* no support for fullscreen windows */
return;
#endif // FAKEFULLSCREEN_CLIENT_PATCH
#endif // !FAKEFULLSCREEN_PATCH
selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed;
#if FLOAT_BORDER_COLOR_PATCH

@ -0,0 +1,17 @@
void
togglefakefullscreen(const Arg *arg)
{
if (!selmon->sel)
return;
if (selmon->sel->fakefullscreen) {
if (selmon->sel->isfullscreen)
selmon->sel->fakefullscreen = 0;
else
selmon->sel->isfullscreen = 0;
} else {
selmon->sel->fakefullscreen = 1;
selmon->sel->isfullscreen = 0;
}
setfullscreen(selmon->sel, !selmon->sel->isfullscreen);
}

@ -0,0 +1 @@
static void togglefakefullscreen(const Arg *arg);

@ -32,6 +32,9 @@
#if EWMHTAGS_PATCH
#include "ewmhtags.c"
#endif
#if FAKEFULLSCREEN_CLIENT_PATCH
#include "fakefullscreenclient.c"
#endif
#if FOCUSADJACENTTAG_PATCH
#include "focusadjacenttag.c"
#endif

@ -35,6 +35,9 @@
#if EXRESIZE_PATCH
#include "exresize.h"
#endif
#if FAKEFULLSCREEN_CLIENT_PATCH
#include "fakefullscreenclient.h"
#endif
#if FOCUSADJACENTTAG_PATCH
#include "focusadjacenttag.h"
#endif

@ -164,6 +164,13 @@
*/
#define FAKEFULLSCREEN_PATCH 0
/* Similarly to the fakefullscreen patch this patch only allows clients to "fullscreen" into
* the space currently given to them.
* The "twist" with this patch is that fake fullscreen can be toggled on a per client basis
* rather than applying to all clients globally.
*/
#define FAKEFULLSCREEN_CLIENT_PATCH 0
/* This patch shows the titles of all visible windows in the status bar
* (as opposed to showing only the selected one).
* Awesomebar takes precedence over fancybar. Fancybar takes precedence over

Loading…
Cancel
Save