catwm: fs toggle

This commit is contained in:
Dylan Araps
2019-10-11 20:22:10 +03:00
parent 277bd8d2de
commit 9cf2ce8736
2 changed files with 25 additions and 1 deletions
+24 -1
View File
@@ -37,8 +37,9 @@ typedef struct client client;
struct client{
client *next;
client *prev;
Window win;
int f, x, y, w, h;
};
typedef struct desktop desktop;
@@ -52,6 +53,7 @@ static void add_window(Window w);
static void buttonpress(XEvent *e);
static void buttonrelease(XEvent *e);
static void center_window();
static void fullscreen_toggle();
static void change_desktop(const Arg arg);
static void client_to_desktop(const Arg arg);
static void configurerequest(XEvent *e);
@@ -150,6 +152,27 @@ void center_window() {
XMoveWindow(dis, current->win, x, y);
}
void fullscreen_toggle() {
if (current->f != 1) {
XGetWindowAttributes(dis, current->win, &attr);
current->f = 1;
current->x = attr.x;
current->y = attr.y;
current->w = attr.width;
current->h = attr.height;
XMoveResizeWindow(dis, current->win, 0, 0, sw, sh);
}
else {
current->f = 0;
XMoveResizeWindow(dis, current->win, current->x, current->y, \
current->w, current->h);
}
}
void client_to_desktop(const Arg arg) {
client *tmp = current;
int tmp2 = curr_desk;
+1
View File
@@ -34,6 +34,7 @@ static struct key keys[] = {
// MOD KEY FUNCTION ARGS
{ MOD, XK_q, kill_client, {NULL}},
{ MOD, XK_c, center_window, {NULL}},
{ MOD, XK_f, fullscreen_toggle, {NULL}},
{ Mod1Mask, XK_Tab, next_win, {NULL}},
{ 0, XF86XK_AudioLowerVolume, spawn, {.com = voldown}},
{ 0, XF86XK_AudioRaiseVolume, spawn, {.com = volup}},