mirror of
https://github.com/mintycube/dwm.git
synced 2024-10-22 12:05:45 +00:00
Adding fakefullscreeenclient patch
This commit is contained in:
parent
5fa724da0d
commit
9b85650c1d
@ -15,6 +15,8 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
|
|||||||
|
|
||||||
### Changelog:
|
### Changelog:
|
||||||
|
|
||||||
|
2019-11-21 - Added fakefullscreenclient patch
|
||||||
|
|
||||||
2019-10-24 - Added dragmfact, extrabar, exresize and nodmenu patches
|
2019-10-24 - Added dragmfact, extrabar, exresize and nodmenu patches
|
||||||
|
|
||||||
2019-10-22 - Added ispermanent and swallow 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
|
- 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
|
- 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/)
|
- [fancybar](https://dwm.suckless.org/patches/fancybar/)
|
||||||
- shows the titles of all visible windows in the status bar
|
- shows the titles of all visible windows in the status bar
|
||||||
|
|
||||||
|
@ -614,6 +614,9 @@ static Key keys[] = {
|
|||||||
#if TOGGLEFULLSCREEN_PATCH
|
#if TOGGLEFULLSCREEN_PATCH
|
||||||
{ MODKEY, XK_y, togglefullscreen, {0} },
|
{ MODKEY, XK_y, togglefullscreen, {0} },
|
||||||
#endif // TOGGLEFULLSCREEN_PATCH
|
#endif // TOGGLEFULLSCREEN_PATCH
|
||||||
|
#if FAKEFULLSCREEN_CLIENT_PATCH
|
||||||
|
{ MODKEY|ShiftMask, XK_y, togglefakefullscreen, {0} },
|
||||||
|
#endif // FAKEFULLSCREEN_CLIENT_PATCH
|
||||||
#if FULLSCREEN_PATCH
|
#if FULLSCREEN_PATCH
|
||||||
{ MODKEY|ShiftMask, XK_f, fullscreen, {0} },
|
{ MODKEY|ShiftMask, XK_f, fullscreen, {0} },
|
||||||
#endif // FULLSCREEN_PATCH
|
#endif // FULLSCREEN_PATCH
|
||||||
|
39
dwm.c
39
dwm.c
@ -150,6 +150,9 @@ struct Client {
|
|||||||
int bw, oldbw;
|
int bw, oldbw;
|
||||||
unsigned int tags;
|
unsigned int tags;
|
||||||
int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen;
|
int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen;
|
||||||
|
#if FAKEFULLSCREEN_CLIENT_PATCH
|
||||||
|
int fakefullscreen;
|
||||||
|
#endif // FAKEFULLSCREEN_CLIENT_PATCH
|
||||||
#if EXRESIZE_PATCH
|
#if EXRESIZE_PATCH
|
||||||
unsigned char expandmask;
|
unsigned char expandmask;
|
||||||
int expandx1, expandy1, expandx2, expandy2;
|
int expandx1, expandy1, expandx2, expandy2;
|
||||||
@ -1034,7 +1037,11 @@ configurenotify(XEvent *e)
|
|||||||
for (m = mons; m; m = m->next) {
|
for (m = mons; m; m = m->next) {
|
||||||
#if !FAKEFULLSCREEN_PATCH
|
#if !FAKEFULLSCREEN_PATCH
|
||||||
for (c = m->clients; c; c = c->next)
|
for (c = m->clients; c; c = c->next)
|
||||||
|
#if FAKEFULLSCREEN_CLIENT_PATCH
|
||||||
|
if (c->isfullscreen && !c->fakefullscreen)
|
||||||
|
#else
|
||||||
if (c->isfullscreen)
|
if (c->isfullscreen)
|
||||||
|
#endif // FAKEFULLSCREEN_CLIENT_PATCH
|
||||||
resizeclient(c, m->mx, m->my, m->mw, m->mh);
|
resizeclient(c, m->mx, m->my, m->mw, m->mh);
|
||||||
#endif // !FAKEFULLSCREEN_PATCH
|
#endif // !FAKEFULLSCREEN_PATCH
|
||||||
XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, m->ww, bh);
|
XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, m->ww, bh);
|
||||||
@ -1668,8 +1675,13 @@ focus(Client *c)
|
|||||||
#if LOSEFULLSCREEN_PATCH
|
#if LOSEFULLSCREEN_PATCH
|
||||||
Client *at;
|
Client *at;
|
||||||
for (at = selmon->clients; at; at = at->next)
|
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))
|
if (at != c && at->isfullscreen && ISVISIBLE(at))
|
||||||
setfullscreen(at, 0);
|
setfullscreen(at, 0);
|
||||||
|
#endif // FAKEFULLSCREEN_CLIENT_PATCH
|
||||||
#endif // LOSEFULLSCREEN_PATCH
|
#endif // LOSEFULLSCREEN_PATCH
|
||||||
drawbars();
|
drawbars();
|
||||||
}
|
}
|
||||||
@ -2119,8 +2131,13 @@ movemouse(const Arg *arg)
|
|||||||
if (!(c = selmon->sel))
|
if (!(c = selmon->sel))
|
||||||
return;
|
return;
|
||||||
#if !FAKEFULLSCREEN_PATCH
|
#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 */
|
if (c->isfullscreen) /* no support moving fullscreen windows by mouse */
|
||||||
return;
|
return;
|
||||||
|
#endif // FAKEFULLSCREEN_CLIENT_PATCH
|
||||||
#endif // FAKEFULLSCREEN_PATCH
|
#endif // FAKEFULLSCREEN_PATCH
|
||||||
restack(selmon);
|
restack(selmon);
|
||||||
ocx = c->x;
|
ocx = c->x;
|
||||||
@ -2353,8 +2370,13 @@ resizemouse(const Arg *arg)
|
|||||||
if (!(c = selmon->sel))
|
if (!(c = selmon->sel))
|
||||||
return;
|
return;
|
||||||
#if !FAKEFULLSCREEN_PATCH
|
#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 */
|
if (c->isfullscreen) /* no support resizing fullscreen windows by mouse */
|
||||||
return;
|
return;
|
||||||
|
#endif // FAKEFULLSCREEN_CLIENT_PATCH
|
||||||
#endif // !FAKEFULLSCREEN_PATCH
|
#endif // !FAKEFULLSCREEN_PATCH
|
||||||
restack(selmon);
|
restack(selmon);
|
||||||
ocx = c->x;
|
ocx = c->x;
|
||||||
@ -2677,18 +2699,27 @@ setfullscreen(Client *c, int fullscreen)
|
|||||||
PropModeReplace, (unsigned char*)&netatom[NetWMFullscreen], 1);
|
PropModeReplace, (unsigned char*)&netatom[NetWMFullscreen], 1);
|
||||||
c->isfullscreen = 1;
|
c->isfullscreen = 1;
|
||||||
#if !FAKEFULLSCREEN_PATCH
|
#if !FAKEFULLSCREEN_PATCH
|
||||||
|
#if FAKEFULLSCREEN_CLIENT_PATCH
|
||||||
|
if (!c->fakefullscreen) {
|
||||||
|
#endif // FAKEFULLSCREEN_CLIENT_PATCH
|
||||||
c->oldstate = c->isfloating;
|
c->oldstate = c->isfloating;
|
||||||
c->oldbw = c->bw;
|
c->oldbw = c->bw;
|
||||||
c->bw = 0;
|
c->bw = 0;
|
||||||
c->isfloating = 1;
|
c->isfloating = 1;
|
||||||
resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh);
|
resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh);
|
||||||
XRaiseWindow(dpy, c->win);
|
XRaiseWindow(dpy, c->win);
|
||||||
|
#if FAKEFULLSCREEN_CLIENT_PATCH
|
||||||
|
}
|
||||||
|
#endif // FAKEFULLSCREEN_CLIENT_PATCH
|
||||||
#endif // !FAKEFULLSCREEN_PATCH
|
#endif // !FAKEFULLSCREEN_PATCH
|
||||||
} else if (!fullscreen && c->isfullscreen){
|
} else if (!fullscreen && c->isfullscreen){
|
||||||
XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32,
|
XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32,
|
||||||
PropModeReplace, (unsigned char*)0, 0);
|
PropModeReplace, (unsigned char*)0, 0);
|
||||||
c->isfullscreen = 0;
|
c->isfullscreen = 0;
|
||||||
#if !FAKEFULLSCREEN_PATCH
|
#if !FAKEFULLSCREEN_PATCH
|
||||||
|
#if FAKEFULLSCREEN_CLIENT_PATCH
|
||||||
|
if (!c->fakefullscreen) {
|
||||||
|
#endif // FAKEFULLSCREEN_CLIENT_PATCH
|
||||||
c->isfloating = c->oldstate;
|
c->isfloating = c->oldstate;
|
||||||
c->bw = c->oldbw;
|
c->bw = c->oldbw;
|
||||||
c->x = c->oldx;
|
c->x = c->oldx;
|
||||||
@ -2697,6 +2728,9 @@ setfullscreen(Client *c, int fullscreen)
|
|||||||
c->h = c->oldh;
|
c->h = c->oldh;
|
||||||
resizeclient(c, c->x, c->y, c->w, c->h);
|
resizeclient(c, c->x, c->y, c->w, c->h);
|
||||||
arrange(c->mon);
|
arrange(c->mon);
|
||||||
|
#if FAKEFULLSCREEN_CLIENT_PATCH
|
||||||
|
}
|
||||||
|
#endif // FAKEFULLSCREEN_CLIENT_PATCH
|
||||||
#endif // !FAKEFULLSCREEN_PATCH
|
#endif // !FAKEFULLSCREEN_PATCH
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3083,8 +3117,13 @@ togglefloating(const Arg *arg)
|
|||||||
if (!selmon->sel)
|
if (!selmon->sel)
|
||||||
return;
|
return;
|
||||||
#if !FAKEFULLSCREEN_PATCH
|
#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 */
|
if (selmon->sel->isfullscreen) /* no support for fullscreen windows */
|
||||||
return;
|
return;
|
||||||
|
#endif // FAKEFULLSCREEN_CLIENT_PATCH
|
||||||
#endif // !FAKEFULLSCREEN_PATCH
|
#endif // !FAKEFULLSCREEN_PATCH
|
||||||
selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed;
|
selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed;
|
||||||
#if FLOAT_BORDER_COLOR_PATCH
|
#if FLOAT_BORDER_COLOR_PATCH
|
||||||
|
17
patch/fakefullscreenclient.c
Normal file
17
patch/fakefullscreenclient.c
Normal file
@ -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);
|
||||||
|
}
|
1
patch/fakefullscreenclient.h
Normal file
1
patch/fakefullscreenclient.h
Normal file
@ -0,0 +1 @@
|
|||||||
|
static void togglefakefullscreen(const Arg *arg);
|
@ -32,6 +32,9 @@
|
|||||||
#if EWMHTAGS_PATCH
|
#if EWMHTAGS_PATCH
|
||||||
#include "ewmhtags.c"
|
#include "ewmhtags.c"
|
||||||
#endif
|
#endif
|
||||||
|
#if FAKEFULLSCREEN_CLIENT_PATCH
|
||||||
|
#include "fakefullscreenclient.c"
|
||||||
|
#endif
|
||||||
#if FOCUSADJACENTTAG_PATCH
|
#if FOCUSADJACENTTAG_PATCH
|
||||||
#include "focusadjacenttag.c"
|
#include "focusadjacenttag.c"
|
||||||
#endif
|
#endif
|
||||||
|
@ -35,6 +35,9 @@
|
|||||||
#if EXRESIZE_PATCH
|
#if EXRESIZE_PATCH
|
||||||
#include "exresize.h"
|
#include "exresize.h"
|
||||||
#endif
|
#endif
|
||||||
|
#if FAKEFULLSCREEN_CLIENT_PATCH
|
||||||
|
#include "fakefullscreenclient.h"
|
||||||
|
#endif
|
||||||
#if FOCUSADJACENTTAG_PATCH
|
#if FOCUSADJACENTTAG_PATCH
|
||||||
#include "focusadjacenttag.h"
|
#include "focusadjacenttag.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -164,6 +164,13 @@
|
|||||||
*/
|
*/
|
||||||
#define FAKEFULLSCREEN_PATCH 0
|
#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
|
/* This patch shows the titles of all visible windows in the status bar
|
||||||
* (as opposed to showing only the selected one).
|
* (as opposed to showing only the selected one).
|
||||||
* Awesomebar takes precedence over fancybar. Fancybar takes precedence over
|
* Awesomebar takes precedence over fancybar. Fancybar takes precedence over
|
||||||
|
Loading…
x
Reference in New Issue
Block a user