mirror of
https://github.com/dylanaraps/sowm.git
synced 2026-09-30 21:14:36 +07:00
catwm: fs toggle
This commit is contained in:
@@ -37,8 +37,9 @@ typedef struct client client;
|
|||||||
struct client{
|
struct client{
|
||||||
client *next;
|
client *next;
|
||||||
client *prev;
|
client *prev;
|
||||||
|
|
||||||
Window win;
|
Window win;
|
||||||
|
|
||||||
|
int f, x, y, w, h;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct desktop desktop;
|
typedef struct desktop desktop;
|
||||||
@@ -52,6 +53,7 @@ static void add_window(Window w);
|
|||||||
static void buttonpress(XEvent *e);
|
static void buttonpress(XEvent *e);
|
||||||
static void buttonrelease(XEvent *e);
|
static void buttonrelease(XEvent *e);
|
||||||
static void center_window();
|
static void center_window();
|
||||||
|
static void fullscreen_toggle();
|
||||||
static void change_desktop(const Arg arg);
|
static void change_desktop(const Arg arg);
|
||||||
static void client_to_desktop(const Arg arg);
|
static void client_to_desktop(const Arg arg);
|
||||||
static void configurerequest(XEvent *e);
|
static void configurerequest(XEvent *e);
|
||||||
@@ -150,6 +152,27 @@ void center_window() {
|
|||||||
XMoveWindow(dis, current->win, x, y);
|
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) {
|
void client_to_desktop(const Arg arg) {
|
||||||
client *tmp = current;
|
client *tmp = current;
|
||||||
int tmp2 = curr_desk;
|
int tmp2 = curr_desk;
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ static struct key keys[] = {
|
|||||||
// MOD KEY FUNCTION ARGS
|
// MOD KEY FUNCTION ARGS
|
||||||
{ MOD, XK_q, kill_client, {NULL}},
|
{ MOD, XK_q, kill_client, {NULL}},
|
||||||
{ MOD, XK_c, center_window, {NULL}},
|
{ MOD, XK_c, center_window, {NULL}},
|
||||||
|
{ MOD, XK_f, fullscreen_toggle, {NULL}},
|
||||||
{ Mod1Mask, XK_Tab, next_win, {NULL}},
|
{ Mod1Mask, XK_Tab, next_win, {NULL}},
|
||||||
{ 0, XF86XK_AudioLowerVolume, spawn, {.com = voldown}},
|
{ 0, XF86XK_AudioLowerVolume, spawn, {.com = voldown}},
|
||||||
{ 0, XF86XK_AudioRaiseVolume, spawn, {.com = volup}},
|
{ 0, XF86XK_AudioRaiseVolume, spawn, {.com = volup}},
|
||||||
|
|||||||
Reference in New Issue
Block a user