Adding fullscreen, holdbar and unfloatvisible patches
This commit is contained in:
13
patch/fullscreen.c
Normal file
13
patch/fullscreen.c
Normal file
@@ -0,0 +1,13 @@
|
||||
Layout *last_layout;
|
||||
|
||||
void
|
||||
fullscreen(const Arg *arg)
|
||||
{
|
||||
if (selmon->showbar) {
|
||||
for (last_layout = (Layout *)layouts; last_layout != selmon->lt[selmon->sellt]; last_layout++);
|
||||
setlayout(&((Arg) { .v = &layouts[2] })); // <-- NB! hardcoded monocle
|
||||
} else {
|
||||
setlayout(&((Arg) { .v = last_layout }));
|
||||
}
|
||||
togglebar(arg);
|
||||
}
|
1
patch/fullscreen.h
Normal file
1
patch/fullscreen.h
Normal file
@@ -0,0 +1 @@
|
||||
static void fullscreen(const Arg *arg);
|
31
patch/holdbar.c
Normal file
31
patch/holdbar.c
Normal file
@@ -0,0 +1,31 @@
|
||||
void
|
||||
holdbar(const Arg *arg)
|
||||
{
|
||||
selmon->showbar = 1;
|
||||
updateholdbarpos(selmon);
|
||||
XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh);
|
||||
}
|
||||
|
||||
void
|
||||
keyrelease(XEvent *e)
|
||||
{
|
||||
if (e->xkey.keycode == XKeysymToKeycode(dpy, HOLDKEY)) {
|
||||
selmon->showbar = 0;
|
||||
updateholdbarpos(selmon);
|
||||
XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh);
|
||||
arrange(selmon);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
updateholdbarpos(Monitor *m)
|
||||
{
|
||||
m->wy = m->my;
|
||||
m->wh = m->mh;
|
||||
if (m->showbar) {
|
||||
m->by = m->topbar ? m->wy : m->wy + m->wh - bh;
|
||||
m->wy = m->topbar ? m->wy - bh + bh : m->wy;
|
||||
} else {
|
||||
m->by = -bh;
|
||||
}
|
||||
}
|
3
patch/holdbar.h
Normal file
3
patch/holdbar.h
Normal file
@@ -0,0 +1,3 @@
|
||||
static void keyrelease(XEvent *e);
|
||||
static void holdbar(const Arg *arg);
|
||||
static void updateholdbarpos(Monitor *m);
|
@@ -36,6 +36,14 @@
|
||||
#include "ewmhtags.c"
|
||||
#endif
|
||||
|
||||
#if FULLSCREEN_PATCH
|
||||
#include "fullscreen.c"
|
||||
#endif
|
||||
|
||||
#if HOLDBAR_PATCH
|
||||
#include "holdbar.c"
|
||||
#endif
|
||||
|
||||
#if PERTAG_PATCH
|
||||
#include "pertag.c"
|
||||
#endif
|
||||
@@ -78,6 +86,10 @@
|
||||
#include "togglefullscreen.c"
|
||||
#endif
|
||||
|
||||
#if UNFLOATVISIBLE_PATCH
|
||||
#include "unfloatvisible.c"
|
||||
#endif
|
||||
|
||||
#if VANITYGAPS_PATCH
|
||||
#include "vanitygaps.c"
|
||||
#endif
|
||||
|
@@ -36,6 +36,14 @@
|
||||
#include "ewmhtags.h"
|
||||
#endif
|
||||
|
||||
#if FULLSCREEN_PATCH
|
||||
#include "fullscreen.h"
|
||||
#endif
|
||||
|
||||
#if HOLDBAR_PATCH
|
||||
#include "holdbar.h"
|
||||
#endif
|
||||
|
||||
#if PERTAG_PATCH
|
||||
#include "pertag.h"
|
||||
#endif
|
||||
@@ -78,6 +86,10 @@
|
||||
#include "togglefullscreen.h"
|
||||
#endif
|
||||
|
||||
#if UNFLOATVISIBLE_PATCH
|
||||
#include "unfloatvisible.h"
|
||||
#endif
|
||||
|
||||
#if VANITYGAPS_PATCH
|
||||
#include "vanitygaps.h"
|
||||
#endif
|
||||
|
14
patch/unfloatvisible.c
Normal file
14
patch/unfloatvisible.c
Normal file
@@ -0,0 +1,14 @@
|
||||
void
|
||||
unfloatvisible(const Arg *arg)
|
||||
{
|
||||
Client *c;
|
||||
|
||||
for (c = selmon->clients; c; c = c->next)
|
||||
if (ISVISIBLE(c) && c->isfloating)
|
||||
c->isfloating = c->isfixed;
|
||||
|
||||
if (arg && arg->v)
|
||||
setlayout(arg);
|
||||
else
|
||||
arrange(selmon);
|
||||
}
|
1
patch/unfloatvisible.h
Normal file
1
patch/unfloatvisible.h
Normal file
@@ -0,0 +1 @@
|
||||
static void unfloatvisible(const Arg *arg);
|
Reference in New Issue
Block a user