mirror of
https://github.com/mintycube/dwm.git
synced 2024-10-22 14:05:45 +02:00
Adding fakefullscreen patch
This commit is contained in:
parent
b32fe221b6
commit
3c9eba037e
@ -13,7 +13,7 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
|
||||
|
||||
### Changelog:
|
||||
|
||||
2019-10-08 - Added columns layout
|
||||
2019-10-08 - Added columns layout and fakefullscreen patch
|
||||
|
||||
2019-10-07 - Added sortscreens and dwmc patches, fixed minor cross-compatibility issues for combo, holdbar, leftlayout, hidevacanttags, taggrid and activetagindicatorbar
|
||||
|
||||
@ -113,6 +113,10 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
|
||||
- [ewmhtags](https://dwm.suckless.org/patches/ewmhtags/)
|
||||
- adds EWMH support for \_NET_NUMBER_OF_DESKTOPS, \_NET_CURRENT_DESKTOP, \_NET_DESKTOP_NAMES and \_NET_DESKTOP_VIEWPORT, which allows for compatibility with other bars and programs that request workspace information, e.g. polybar's xworkspaces module
|
||||
|
||||
- [fakefullscreen](https://dwm.suckless.org/patches/fakefullscreen/)
|
||||
- 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
|
||||
|
||||
- [fancybar](https://dwm.suckless.org/patches/fancybar/)
|
||||
- shows the titles of all visible windows in the status bar
|
||||
|
||||
|
26
dwm.c
26
dwm.c
@ -919,7 +919,11 @@ clientmessage(XEvent *e)
|
||||
if (cme->data.l[1] == netatom[NetWMFullscreen]
|
||||
|| cme->data.l[2] == netatom[NetWMFullscreen])
|
||||
setfullscreen(c, (cme->data.l[0] == 1 /* _NET_WM_STATE_ADD */
|
||||
|| (cme->data.l[0] == 2 /* _NET_WM_STATE_TOGGLE */ && !c->isfullscreen)));
|
||||
|| (cme->data.l[0] == 2 /* _NET_WM_STATE_TOGGLE */
|
||||
#if !FAKEFULLSCREEN_PATCH
|
||||
&& !c->isfullscreen
|
||||
#endif // !FAKEFULLSCREEN_PATCH
|
||||
)));
|
||||
} else if (cme->message_type == netatom[NetActiveWindow]) {
|
||||
#if FOCUSONNETACTIVE_PATCH
|
||||
for (i = 0; i < LENGTH(tags) && !((1 << i) & c->tags); i++);
|
||||
@ -960,7 +964,9 @@ void
|
||||
configurenotify(XEvent *e)
|
||||
{
|
||||
Monitor *m;
|
||||
#if !FAKEFULLSCREEN_PATCH
|
||||
Client *c;
|
||||
#endif // !FAKEFULLSCREEN_PATCH
|
||||
XConfigureEvent *ev = &e->xconfigure;
|
||||
int dirty;
|
||||
|
||||
@ -973,9 +979,11 @@ configurenotify(XEvent *e)
|
||||
drw_resize(drw, sw, bh);
|
||||
updatebars();
|
||||
for (m = mons; m; m = m->next) {
|
||||
#if !FAKEFULLSCREEN_PATCH
|
||||
for (c = m->clients; c; c = c->next)
|
||||
if (c->isfullscreen)
|
||||
resizeclient(c, m->mx, m->my, m->mw, m->mh);
|
||||
#endif // !FAKEFULLSCREEN_PATCH
|
||||
XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, m->ww, bh);
|
||||
}
|
||||
focus(NULL);
|
||||
@ -2006,8 +2014,10 @@ movemouse(const Arg *arg)
|
||||
|
||||
if (!(c = selmon->sel))
|
||||
return;
|
||||
#if !FAKEFULLSCREEN_PATCH
|
||||
if (c->isfullscreen) /* no support moving fullscreen windows by mouse */
|
||||
return;
|
||||
#endif // FAKEFULLSCREEN_PATCH
|
||||
restack(selmon);
|
||||
ocx = c->x;
|
||||
ocy = c->y;
|
||||
@ -2235,8 +2245,10 @@ resizemouse(const Arg *arg)
|
||||
|
||||
if (!(c = selmon->sel))
|
||||
return;
|
||||
#if !FAKEFULLSCREEN_PATCH
|
||||
if (c->isfullscreen) /* no support resizing fullscreen windows by mouse */
|
||||
return;
|
||||
#endif // !FAKEFULLSCREEN_PATCH
|
||||
restack(selmon);
|
||||
ocx = c->x;
|
||||
ocy = c->y;
|
||||
@ -2508,16 +2520,19 @@ setfullscreen(Client *c, int fullscreen)
|
||||
XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32,
|
||||
PropModeReplace, (unsigned char*)&netatom[NetWMFullscreen], 1);
|
||||
c->isfullscreen = 1;
|
||||
#if !FAKEFULLSCREEN_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);
|
||||
#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
|
||||
c->isfloating = c->oldstate;
|
||||
c->bw = c->oldbw;
|
||||
c->x = c->oldx;
|
||||
@ -2526,6 +2541,7 @@ setfullscreen(Client *c, int fullscreen)
|
||||
c->h = c->oldh;
|
||||
resizeclient(c, c->x, c->y, c->w, c->h);
|
||||
arrange(c->mon);
|
||||
#endif // !FAKEFULLSCREEN_PATCH
|
||||
}
|
||||
}
|
||||
|
||||
@ -2756,7 +2772,11 @@ showhide(Client *c)
|
||||
#else
|
||||
XMoveWindow(dpy, c->win, c->x, c->y);
|
||||
#endif // AUTORESIZE_PATCH
|
||||
if ((!c->mon->lt[c->mon->sellt]->arrange || c->isfloating) && !c->isfullscreen)
|
||||
if ((!c->mon->lt[c->mon->sellt]->arrange || c->isfloating)
|
||||
#if !FAKEFULLSCREEN_PATCH
|
||||
&& !c->isfullscreen
|
||||
#endif // !FAKEFULLSCREEN_PATCH
|
||||
)
|
||||
resize(c, c->x, c->y, c->w, c->h, 0);
|
||||
showhide(c->snext);
|
||||
} else {
|
||||
@ -2853,8 +2873,10 @@ togglefloating(const Arg *arg)
|
||||
{
|
||||
if (!selmon->sel)
|
||||
return;
|
||||
#if !FAKEFULLSCREEN_PATCH
|
||||
if (selmon->sel->isfullscreen) /* no support for fullscreen windows */
|
||||
return;
|
||||
#endif // !FAKEFULLSCREEN_PATCH
|
||||
selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed;
|
||||
#if FLOAT_BORDER_COLOR_PATCH
|
||||
if (selmon->sel->isfloating)
|
||||
|
@ -136,6 +136,13 @@
|
||||
*/
|
||||
#define EWMHTAGS_PATCH 0
|
||||
|
||||
/* 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.
|
||||
* https://dwm.suckless.org/patches/fakefullscreen/
|
||||
*/
|
||||
#define FAKEFULLSCREEN_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…
Reference in New Issue
Block a user