mirror of
https://github.com/dylanaraps/sowm.git
synced 2026-10-25 12:14:45 +00:00
catwm: fs toggle
This commit is contained in:
1 parent
277bd8d2de
commit
9cf2ce8736
2 files changed
+25
-1
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user