[ALL] Fix some bug, test some features...
This commit is contained in:
1
config.c
1
config.c
@@ -11,7 +11,6 @@ func_name_list_t func_list[] = {
|
|||||||
{"spawn", spawn},
|
{"spawn", spawn},
|
||||||
{"killclient", killclient},
|
{"killclient", killclient},
|
||||||
{"wswitch", wswitch},
|
{"wswitch", wswitch},
|
||||||
{"tagswitch", tagswitch},
|
|
||||||
{"togglemax", togglemax},
|
{"togglemax", togglemax},
|
||||||
{"keymovex", keymovex},
|
{"keymovex", keymovex},
|
||||||
{"keymovey", keymovey},
|
{"keymovey", keymovey},
|
||||||
|
|||||||
17
local.h
17
local.h
@@ -7,6 +7,7 @@
|
|||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <errno.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
@@ -42,15 +43,16 @@ struct Client {
|
|||||||
int tag; /* tag num */
|
int tag; /* tag num */
|
||||||
int x, y, w, h; /* window attribute */
|
int x, y, w, h; /* window attribute */
|
||||||
int ox, oy, ow, oh; /* old window attribute */
|
int ox, oy, ow, oh; /* old window attribute */
|
||||||
int basew, baseh;
|
int basew, baseh, incw, inch;
|
||||||
int incw, inch;
|
|
||||||
int maxw, maxh, minw, minh;
|
int maxw, maxh, minw, minh;
|
||||||
|
int minax, maxax, minay, maxay;
|
||||||
int border; /* border height */
|
int border; /* border height */
|
||||||
Window win; /* window */
|
Window win; /* window */
|
||||||
Window tbar; /* Titlebar? */
|
Window tbar; /* Titlebar */
|
||||||
Window button; /* Close Button */
|
Window button; /* Close Button */
|
||||||
Bool max, tile, free; /* Client Info */
|
Bool max, tile, free; /* Client Info */
|
||||||
Bool hint, hide; /* Client Info² */
|
Bool hint, hide; /* Client Info² */
|
||||||
|
Bool fixed; /* Client info³ */
|
||||||
Client *next; /* next client */
|
Client *next; /* next client */
|
||||||
Client *prev; /* previous client */
|
Client *prev; /* previous client */
|
||||||
};
|
};
|
||||||
@@ -123,6 +125,7 @@ void configurerequest(XEvent event);
|
|||||||
void detach(Client *c);
|
void detach(Client *c);
|
||||||
void *emallocz(unsigned int size);
|
void *emallocz(unsigned int size);
|
||||||
int errorhandler(Display *d, XErrorEvent *event);
|
int errorhandler(Display *d, XErrorEvent *event);
|
||||||
|
int errorhandlerdummy(Display *d, XErrorEvent *event);
|
||||||
void focus(Client *c);
|
void focus(Client *c);
|
||||||
void freelayout(void);
|
void freelayout(void);
|
||||||
Client* getbutton(Window w);
|
Client* getbutton(Window w);
|
||||||
@@ -138,7 +141,6 @@ void hide(Client *c);
|
|||||||
void init(void);
|
void init(void);
|
||||||
Bool ishide(Client *c);
|
Bool ishide(Client *c);
|
||||||
void keymovex(char *cmd);
|
void keymovex(char *cmd);
|
||||||
|
|
||||||
void keymovey(char *cmd);
|
void keymovey(char *cmd);
|
||||||
void keypress(XEvent *e);
|
void keypress(XEvent *e);
|
||||||
void keyresize(char *cmd);
|
void keyresize(char *cmd);
|
||||||
@@ -159,9 +161,9 @@ void set_nmaster(char *cmd);
|
|||||||
void setsizehints(Client *c);
|
void setsizehints(Client *c);
|
||||||
void spawn(char *cmd);
|
void spawn(char *cmd);
|
||||||
void tag(char *cmd);
|
void tag(char *cmd);
|
||||||
void tagswitch(char *cmd);
|
|
||||||
void tagtransfert(char *cmd);
|
void tagtransfert(char *cmd);
|
||||||
void tile(void);
|
void tile(void);
|
||||||
|
void tile_switch(char *cmd);
|
||||||
void togglemax(char *cmd);
|
void togglemax(char *cmd);
|
||||||
void unhide(Client *c);
|
void unhide(Client *c);
|
||||||
void unmanage(Client *c);
|
void unmanage(Client *c);
|
||||||
@@ -199,17 +201,16 @@ int seltag;
|
|||||||
Client *clients; /* First Client */
|
Client *clients; /* First Client */
|
||||||
Client *sel; /* selected client */
|
Client *sel; /* selected client */
|
||||||
Client *selbytag[MAXTAG];
|
Client *selbytag[MAXTAG];
|
||||||
char status[16];
|
|
||||||
|
|
||||||
/* layout */
|
/* layout */
|
||||||
float mwfact[MAXTAG];
|
float mwfact[MAXTAG];
|
||||||
int nmaster[MAXTAG];
|
int nmaster[MAXTAG];
|
||||||
int layout[MAXTAG];
|
int layout[MAXTAG];
|
||||||
/**/
|
/**/
|
||||||
char bartext[256];
|
|
||||||
|
char bartext[1024];
|
||||||
char *ptrb, bufbt[sizeof bartext];
|
char *ptrb, bufbt[sizeof bartext];
|
||||||
int readp;
|
int readp;
|
||||||
Bool readin;
|
|
||||||
unsigned int offset, len;
|
unsigned int offset, len;
|
||||||
|
|
||||||
#endif /* LOCAL_H */
|
#endif /* LOCAL_H */
|
||||||
|
|||||||
225
wmfs.c
225
wmfs.c
@@ -37,9 +37,10 @@ arrange(void) {
|
|||||||
unhide(c);
|
unhide(c);
|
||||||
else
|
else
|
||||||
hide(c);
|
hide(c);
|
||||||
|
focus(selbytag[seltag]);
|
||||||
|
|
||||||
updatelayout();
|
updatelayout();
|
||||||
updateall();
|
updateall();
|
||||||
focus(NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -61,11 +62,11 @@ buttonpress(XEvent *event) {
|
|||||||
/* Tbar'n'Button */
|
/* Tbar'n'Button */
|
||||||
if(conf.ttbarheight) {
|
if(conf.ttbarheight) {
|
||||||
if((c = gettbar(ev->window))) {
|
if((c = gettbar(ev->window))) {
|
||||||
focus(c);
|
raiseclient(c);
|
||||||
if(ev->button == Button1)
|
if(ev->button == Button1)
|
||||||
mouseaction(c, ev->x_root, ev->y_root, Move); /* type 0 for move */
|
mouseaction(c, ev->x_root, ev->y_root, Move); /* type 0 for move */
|
||||||
else if(ev->button == Button2)
|
else if(ev->button == Button2)
|
||||||
togglemax(NULL);
|
tile_switch(NULL);
|
||||||
else if(ev->button == Button3)
|
else if(ev->button == Button3)
|
||||||
mouseaction(c, ev->x_root, ev->y_root, Resize); /* type 1 for resize */
|
mouseaction(c, ev->x_root, ev->y_root, Resize); /* type 1 for resize */
|
||||||
} else if((c = getbutton(ev->window))) {
|
} else if((c = getbutton(ev->window))) {
|
||||||
@@ -102,9 +103,9 @@ buttonpress(XEvent *event) {
|
|||||||
/* tag switch with scroll */
|
/* tag switch with scroll */
|
||||||
if(ev->x < taglen[conf.ntag]) {
|
if(ev->x < taglen[conf.ntag]) {
|
||||||
if(ev->button == Button4)
|
if(ev->button == Button4)
|
||||||
tagswitch("+1");
|
tag("+1");
|
||||||
else if(ev->button == Button5)
|
else if(ev->button == Button5)
|
||||||
tagswitch("-1");
|
tag("-1");
|
||||||
}
|
}
|
||||||
/* layout switch */
|
/* layout switch */
|
||||||
if(ev->x >= taglen[conf.ntag]
|
if(ev->x >= taglen[conf.ntag]
|
||||||
@@ -122,9 +123,9 @@ buttonpress(XEvent *event) {
|
|||||||
/* tag switch */
|
/* tag switch */
|
||||||
else if(ev->window == root) {
|
else if(ev->window == root) {
|
||||||
if(ev->button == Button4)
|
if(ev->button == Button4)
|
||||||
tagswitch("+1");
|
tag("+1");
|
||||||
else if(ev->button == Button5)
|
else if(ev->button == Button5)
|
||||||
tagswitch("-1");
|
tag("-1");
|
||||||
}
|
}
|
||||||
/* Bar Button */
|
/* Bar Button */
|
||||||
for(i=0; i<conf.nbutton ; ++i)
|
for(i=0; i<conf.nbutton ; ++i)
|
||||||
@@ -159,7 +160,7 @@ void
|
|||||||
configurerequest(XEvent event) {
|
configurerequest(XEvent event) {
|
||||||
Client *c;
|
Client *c;
|
||||||
XWindowChanges wc;
|
XWindowChanges wc;
|
||||||
if(layout[seltag] == Tile)
|
if(layout[seltag] != Free)
|
||||||
return;
|
return;
|
||||||
wc.x = event.xconfigurerequest.x;
|
wc.x = event.xconfigurerequest.x;
|
||||||
wc.y = event.xconfigurerequest.y;
|
wc.y = event.xconfigurerequest.y;
|
||||||
@@ -173,7 +174,6 @@ configurerequest(XEvent event) {
|
|||||||
if((c = getclient(event.xconfigurerequest.window))) {
|
if((c = getclient(event.xconfigurerequest.window))) {
|
||||||
if(wc.y < mw && wc.x < mh) {
|
if(wc.y < mw && wc.x < mh) {
|
||||||
c->free = True;
|
c->free = True;
|
||||||
c->hint = True;
|
|
||||||
c->max = False;
|
c->max = False;
|
||||||
|
|
||||||
if(conf.ttbarheight) {
|
if(conf.ttbarheight) {
|
||||||
@@ -220,6 +220,11 @@ errorhandler(Display *d, XErrorEvent *event) {
|
|||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
errorhandlerdummy(Display *d, XErrorEvent *event) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
focus(Client *c) {
|
focus(Client *c) {
|
||||||
if(sel && sel != c) {
|
if(sel && sel != c) {
|
||||||
@@ -292,6 +297,21 @@ getlayoutsym(int l) {
|
|||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
getstatuscmd(char *cmd, char *buf, size_t bufsize) {
|
||||||
|
int i;
|
||||||
|
if(!cmd || !buf || !bufsize)
|
||||||
|
return;
|
||||||
|
|
||||||
|
FILE *f = popen(cmd, "r");
|
||||||
|
fgets(buf, bufsize, f);
|
||||||
|
for(i = 0; i< bufsize; ++i)
|
||||||
|
if(buf[i] == '\n')
|
||||||
|
buf[i] = '\0';
|
||||||
|
fclose(f);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Client*
|
Client*
|
||||||
gettbar(Window w) {
|
gettbar(Window w) {
|
||||||
Client *c;
|
Client *c;
|
||||||
@@ -303,6 +323,7 @@ void
|
|||||||
getevent(void) {
|
getevent(void) {
|
||||||
XWindowAttributes at;
|
XWindowAttributes at;
|
||||||
Client *c;
|
Client *c;
|
||||||
|
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
|
|
||||||
if(QLength(dpy) > 0)
|
if(QLength(dpy) > 0)
|
||||||
@@ -371,7 +392,7 @@ getevent(void) {
|
|||||||
XSetInputFocus(dpy, sel->win, RevertToPointerRoot, CurrentTime);
|
XSetInputFocus(dpy, sel->win, RevertToPointerRoot, CurrentTime);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case KeyPress: keypress(&event); break;
|
case KeyPress: keypress(&event); break;
|
||||||
case ButtonPress: buttonpress(&event); break;
|
case ButtonPress: buttonpress(&event); break;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@@ -554,7 +575,6 @@ init(void) {
|
|||||||
/* INIT STUFF */
|
/* INIT STUFF */
|
||||||
XSetErrorHandler(errorhandler);
|
XSetErrorHandler(errorhandler);
|
||||||
grabkeys();
|
grabkeys();
|
||||||
readin = True;
|
|
||||||
offset = 0;
|
offset = 0;
|
||||||
len = sizeof bartext - 1;
|
len = sizeof bartext - 1;
|
||||||
bufbt[len] = bartext[len] = '\0';
|
bufbt[len] = bartext[len] = '\0';
|
||||||
@@ -734,6 +754,7 @@ manage(Window w, XWindowAttributes *wa) {
|
|||||||
conf.borderheight,
|
conf.borderheight,
|
||||||
conf.colors.bordernormal,
|
conf.colors.bordernormal,
|
||||||
conf.colors.bar);
|
conf.colors.bar);
|
||||||
|
XSelectInput(dpy, c->tbar, ExposureMask | EnterWindowMask);
|
||||||
c->button =
|
c->button =
|
||||||
XCreateSimpleWindow(dpy, root,
|
XCreateSimpleWindow(dpy, root,
|
||||||
c->x + c->w - 10,
|
c->x + c->w - 10,
|
||||||
@@ -757,13 +778,12 @@ manage(Window w, XWindowAttributes *wa) {
|
|||||||
for(t = clients; t && t->win != trans; t = t->next);
|
for(t = clients; t && t->win != trans; t = t->next);
|
||||||
if(t)
|
if(t)
|
||||||
c->tag = t->tag;
|
c->tag = t->tag;
|
||||||
|
|
||||||
attach(c);
|
attach(c);
|
||||||
moveresize(c, c->x, c->y, c->w, c->h, 1);
|
moveresize(c, c->x, c->y, c->w, c->h, 1);
|
||||||
|
|
||||||
/* for when there are a free client
|
if(!c->hint)
|
||||||
over the tiled client */
|
raiseclient(c);
|
||||||
//if(c->tile)
|
|
||||||
// lowerclient(c);
|
|
||||||
|
|
||||||
XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h);
|
XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h);
|
||||||
mapclient(c);
|
mapclient(c);
|
||||||
@@ -798,7 +818,6 @@ maxlayout(void) {
|
|||||||
|
|
||||||
/* If the type is 0, this function will move, else,
|
/* If the type is 0, this function will move, else,
|
||||||
this will resize */
|
this will resize */
|
||||||
|
|
||||||
void
|
void
|
||||||
mouseaction(Client *c, int x, int y, int type) {
|
mouseaction(Client *c, int x, int y, int type) {
|
||||||
int ocx, ocy;
|
int ocx, ocy;
|
||||||
@@ -829,7 +848,7 @@ mouseaction(Client *c, int x, int y, int type) {
|
|||||||
if(type) /* Resize */
|
if(type) /* Resize */
|
||||||
moveresize(c, c->x, c->y,
|
moveresize(c, c->x, c->y,
|
||||||
((ev.xmotion.x - ocx <= 0) ? 1 : ev.xmotion.x - ocx),
|
((ev.xmotion.x - ocx <= 0) ? 1 : ev.xmotion.x - ocx),
|
||||||
((ev.xmotion.y - ocy <= 0) ? 1 : ev.xmotion.y - ocy), 0);
|
((ev.xmotion.y - ocy <= 0) ? 1 : ev.xmotion.y - ocy), 1);
|
||||||
else /* Move */
|
else /* Move */
|
||||||
moveresize(c,
|
moveresize(c,
|
||||||
(ocx + (ev.xmotion.x - x)),
|
(ocx + (ev.xmotion.x - x)),
|
||||||
@@ -850,30 +869,45 @@ moveresize(Client *c, int x, int y, int w, int h, bool r) {
|
|||||||
if(c) {
|
if(c) {
|
||||||
/* Resize hints {{{ */
|
/* Resize hints {{{ */
|
||||||
if(r) {
|
if(r) {
|
||||||
if(c->minw > 0 && w < c->minw) {
|
/* minimum possible */
|
||||||
|
if (w < 1)
|
||||||
|
w = 1;
|
||||||
|
if (h < 1)
|
||||||
|
h = 1;
|
||||||
|
|
||||||
|
/* base */
|
||||||
|
w -= c->basew;
|
||||||
|
h -= c->baseh;
|
||||||
|
|
||||||
|
/* aspect */
|
||||||
|
if (c->minay > 0
|
||||||
|
&& c->maxay > 0
|
||||||
|
&& c->minax > 0
|
||||||
|
&& c->maxax > 0) {
|
||||||
|
if (w * c->maxay > h * c->maxax)
|
||||||
|
w = h * c->maxax / c->maxay;
|
||||||
|
else if (w * c->minay < h * c->minax)
|
||||||
|
h = w * c->minay / c->minax;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* incremental */
|
||||||
|
if(c->incw)
|
||||||
|
w -= w % c->incw;
|
||||||
|
if(c->inch)
|
||||||
|
h -= h % c->inch;
|
||||||
|
|
||||||
|
/* base dimension */
|
||||||
|
w += c->basew;
|
||||||
|
h += c->baseh;
|
||||||
|
|
||||||
|
if(c->minw > 0 && w < c->minw)
|
||||||
w = c->minw;
|
w = c->minw;
|
||||||
c->hint = c->free = True;
|
if(c->minh > 0 && h < c->minh)
|
||||||
c->tile = False;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(c->minh > 0 && h < c->minh) {
|
|
||||||
h = c->minh;
|
h = c->minh;
|
||||||
c->hint = c->free = True;
|
if(c->maxw > 0 && w > c->maxw)
|
||||||
c->tile = False;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(c->maxw > 0 && w > c->maxw) {
|
|
||||||
w = c->maxw;
|
w = c->maxw;
|
||||||
c->hint = c->free = True;
|
if(c->maxh > 0 && h > c->maxh)
|
||||||
c->tile = False;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(c->maxh > 0 && h > c->maxh) {
|
|
||||||
h = c->maxh;
|
h = c->maxh;
|
||||||
c->hint = c-> free = True;
|
|
||||||
c->tile = False;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(w <= 0 || h <= 0)
|
if(w <= 0 || h <= 0)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -987,28 +1021,53 @@ setsizehints(Client *c) {
|
|||||||
|
|
||||||
if(!XGetWMNormalHints(dpy, c->win, &size, &msize) || !size.flags)
|
if(!XGetWMNormalHints(dpy, c->win, &size, &msize) || !size.flags)
|
||||||
size.flags = PSize;
|
size.flags = PSize;
|
||||||
|
/* base */
|
||||||
if(size.flags & PBaseSize) {
|
if(size.flags & PBaseSize) {
|
||||||
c->basew = size.base_width; c->baseh = size.base_height;
|
c->basew = size.base_width;
|
||||||
|
c->baseh = size.base_height;
|
||||||
}
|
}
|
||||||
else if(size.flags & PMinSize) {
|
else if(size.flags & PMinSize) {
|
||||||
c->basew = size.min_width; c->baseh = size.min_height;
|
c->basew = size.min_width;
|
||||||
|
c->baseh = size.min_height;
|
||||||
}
|
}
|
||||||
else c->basew = c->baseh = 0;
|
else
|
||||||
|
c->basew = c->baseh = 0;
|
||||||
|
/* inc */
|
||||||
if(size.flags & PResizeInc) {
|
if(size.flags & PResizeInc) {
|
||||||
c->incw = size.width_inc; c->inch = size.height_inc;
|
c->incw = size.width_inc;
|
||||||
|
c->inch = size.height_inc;
|
||||||
}
|
}
|
||||||
else c->incw = c->inch = 0;
|
else
|
||||||
|
c->incw = c->inch = 0;
|
||||||
|
/* nax */
|
||||||
if(size.flags & PMaxSize) {
|
if(size.flags & PMaxSize) {
|
||||||
c->maxw = size.max_width; c->maxh = size.max_height;
|
c->maxw = size.max_width;
|
||||||
|
c->maxh = size.max_height;
|
||||||
}
|
}
|
||||||
else c->maxw = c->maxh = 0;
|
else
|
||||||
|
c->maxw = c->maxh = 0;
|
||||||
|
/* min */
|
||||||
if(size.flags & PMinSize) {
|
if(size.flags & PMinSize) {
|
||||||
c->minw = size.min_width; c->minh = size.min_height;
|
c->minw = size.min_width;
|
||||||
|
c->minh = size.min_height;
|
||||||
}
|
}
|
||||||
else if(size.flags & PBaseSize) {
|
else if(size.flags & PBaseSize) {
|
||||||
c->minw = size.base_width; c->minh = size.base_height;
|
c->minw = size.base_width;
|
||||||
|
c->minh = size.base_height;
|
||||||
}
|
}
|
||||||
else c->minw = c->minh = 0;
|
else
|
||||||
|
c->minw = c->minh = 0;
|
||||||
|
/* aspect */
|
||||||
|
if(size.flags & PAspect) {
|
||||||
|
c->minax = size.min_aspect.x;
|
||||||
|
c->maxax = size.max_aspect.x;
|
||||||
|
c->minay = size.min_aspect.y;
|
||||||
|
c->maxay = size.max_aspect.y;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
c->minax = c->maxax = c->minay = c->maxay = 0;
|
||||||
|
c->hint = (c->maxw && c->minw && c->maxh && c->minh
|
||||||
|
&& c->maxw == c->minw && c->maxh == c->minh);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -1032,26 +1091,19 @@ void
|
|||||||
tag(char *cmd) {
|
tag(char *cmd) {
|
||||||
int tmp = atoi(cmd);
|
int tmp = atoi(cmd);
|
||||||
|
|
||||||
if(tmp > conf.ntag || tmp < 1 || tmp == seltag)
|
|
||||||
return;
|
|
||||||
|
|
||||||
seltag = tmp;
|
if(cmd[0] == '+' || cmd[0] == '-') {
|
||||||
if(selbytag[seltag])
|
if(tmp + seltag < 1
|
||||||
focus(selbytag[seltag]);
|
|| tmp + seltag > conf.ntag)
|
||||||
|
return;
|
||||||
|
seltag += tmp;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if(tmp == seltag)
|
||||||
|
return;
|
||||||
|
seltag = tmp;
|
||||||
|
}
|
||||||
|
|
||||||
arrange();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
tagswitch(char *cmd) {
|
|
||||||
int tmp;
|
|
||||||
|
|
||||||
tmp = atoi(cmd);
|
|
||||||
if(seltag + tmp > conf.ntag || seltag + tmp < 1)
|
|
||||||
return;
|
|
||||||
|
|
||||||
seltag += tmp;
|
|
||||||
if(selbytag[seltag])
|
if(selbytag[seltag])
|
||||||
focus(selbytag[seltag]);
|
focus(selbytag[seltag]);
|
||||||
|
|
||||||
@@ -1128,6 +1180,19 @@ tile(void) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
tile_switch(char *cmd) {
|
||||||
|
Client *c;
|
||||||
|
if(!sel || sel->hint || !sel->tile)
|
||||||
|
return;
|
||||||
|
if((c = sel) == nexttiled(clients))
|
||||||
|
if(!(c = nexttiled(c->next)))
|
||||||
|
return;
|
||||||
|
detach(c);
|
||||||
|
attach(c);
|
||||||
|
focus(c);
|
||||||
|
arrange();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
togglemax(char *cmd) {
|
togglemax(char *cmd) {
|
||||||
@@ -1149,9 +1214,8 @@ togglemax(char *cmd) {
|
|||||||
sel->ox,
|
sel->ox,
|
||||||
sel->oy,
|
sel->oy,
|
||||||
sel->ow,
|
sel->ow,
|
||||||
sel->oh, 1);
|
sel->oh, 0);
|
||||||
sel->max = False;
|
sel->max = False;
|
||||||
sel->free = True;
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1177,19 +1241,15 @@ unhide(Client *c) {
|
|||||||
|
|
||||||
void
|
void
|
||||||
unmanage(Client *c) {
|
unmanage(Client *c) {
|
||||||
XSetErrorHandler(errorhandler);
|
XSetErrorHandler(errorhandlerdummy);
|
||||||
int i;
|
|
||||||
|
|
||||||
sel = (sel == c) ? c->next : NULL;
|
sel = (sel == c) ? c->next : NULL;
|
||||||
for(i = 0; i < conf.ntag; ++i)
|
selbytag[seltag] = (selbytag[seltag] == c) ? c->next : NULL;
|
||||||
selbytag[i] = (selbytag[i] == c) ? c->next : NULL;
|
|
||||||
if(conf.ttbarheight) {
|
if(conf.ttbarheight) {
|
||||||
XUnmapWindow(dpy, c->tbar);
|
XUnmapWindow(dpy, c->tbar);
|
||||||
XDestroyWindow(dpy, c->tbar);
|
XDestroyWindow(dpy, c->tbar);
|
||||||
XUnmapWindow(dpy, c->button);
|
XUnmapWindow(dpy, c->button);
|
||||||
XDestroyWindow(dpy, c->button);
|
XDestroyWindow(dpy, c->button);
|
||||||
}
|
}
|
||||||
|
|
||||||
detach(c);
|
detach(c);
|
||||||
free(c);
|
free(c);
|
||||||
arrange();
|
arrange();
|
||||||
@@ -1240,7 +1300,7 @@ updatebar(void) {
|
|||||||
getlayoutsym(layout[seltag]),
|
getlayoutsym(layout[seltag]),
|
||||||
strlen(getlayoutsym(layout[seltag])));
|
strlen(getlayoutsym(layout[seltag])));
|
||||||
|
|
||||||
/* Draw stdin */
|
/* Draw status */
|
||||||
|
|
||||||
sprintf(bartext,"mwfact: %.2f nmaster: %i - %02i:%02i",
|
sprintf(bartext,"mwfact: %.2f nmaster: %i - %02i:%02i",
|
||||||
mwfact[seltag],
|
mwfact[seltag],
|
||||||
@@ -1248,6 +1308,11 @@ updatebar(void) {
|
|||||||
tm->tm_hour,
|
tm->tm_hour,
|
||||||
tm->tm_min);
|
tm->tm_min);
|
||||||
|
|
||||||
|
/*
|
||||||
|
getstatuscmd("/home/martin/status.sh", status, sizeof status);
|
||||||
|
sprintf(bartext, "%s", status);
|
||||||
|
*/
|
||||||
|
debug(89);
|
||||||
j = strlen(bartext);
|
j = strlen(bartext);
|
||||||
XSetForeground(dpy, gc, conf.colors.text);
|
XSetForeground(dpy, gc, conf.colors.text);
|
||||||
XDrawString(dpy, bar, gc, mw - j * fonty, fonth-1 , bartext ,j);
|
XDrawString(dpy, bar, gc, mw - j * fonty, fonth-1 , bartext ,j);
|
||||||
@@ -1356,7 +1421,8 @@ wswitch(char *cmd) {
|
|||||||
for(c = clients; c && ishide(c); c = c->next);
|
for(c = clients; c && ishide(c); c = c->next);
|
||||||
if(c) {
|
if(c) {
|
||||||
focus(c);
|
focus(c);
|
||||||
raiseclient(c);
|
if(!c->tile)
|
||||||
|
raiseclient(c);
|
||||||
}
|
}
|
||||||
} else if(cmd[0] == '-') {
|
} else if(cmd[0] == '-') {
|
||||||
for(c = sel->prev; c && ishide(c); c = c->prev);
|
for(c = sel->prev; c && ishide(c); c = c->prev);
|
||||||
@@ -1366,10 +1432,9 @@ wswitch(char *cmd) {
|
|||||||
}
|
}
|
||||||
if(c) {
|
if(c) {
|
||||||
focus(c);
|
focus(c);
|
||||||
raiseclient(c);
|
if(!c->tile)
|
||||||
|
raiseclient(c);
|
||||||
}
|
}
|
||||||
if(c->y > mh)
|
|
||||||
tile();
|
|
||||||
}
|
}
|
||||||
updateall();
|
updateall();
|
||||||
return;
|
return;
|
||||||
@@ -1420,12 +1485,10 @@ main(int argc,char **argv) {
|
|||||||
init();
|
init();
|
||||||
scan();
|
scan();
|
||||||
for(;;) {
|
for(;;) {
|
||||||
/* Not finish */
|
|
||||||
/* getstdin(); */
|
|
||||||
updatebar();
|
updatebar();
|
||||||
getevent();
|
getevent();
|
||||||
updateall();
|
updateall();
|
||||||
}
|
}
|
||||||
|
|
||||||
XCloseDisplay(dpy);
|
XCloseDisplay(dpy);
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
4
wmfsrc
4
wmfsrc
@@ -102,8 +102,8 @@ keys
|
|||||||
key { mod = {"Control"} key = "m" func = "togglemax" }
|
key { mod = {"Control"} key = "m" func = "togglemax" }
|
||||||
key { mod = {"Alt"} key = "Tab" func = "wswitch" cmd = "+" }
|
key { mod = {"Alt"} key = "Tab" func = "wswitch" cmd = "+" }
|
||||||
key { mod = {"Alt","Shift"} key = "Tab" func = "wswitch" cmd = "-" }
|
key { mod = {"Alt","Shift"} key = "Tab" func = "wswitch" cmd = "-" }
|
||||||
key { mod = {"Control"} key = "Right" func = "tagswitch" cmd = "+1" }
|
key { mod = {"Control"} key = "Right" func = "tag" cmd = "+1" }
|
||||||
key { mod = {"Control"} key = "Left" func = "tagswitch" cmd = "-1" }
|
key { mod = {"Control"} key = "Left" func = "tag" cmd = "-1" }
|
||||||
key { mod = {"Control"} key = "Up" func = "layoutswitch" cmd = "+" }
|
key { mod = {"Control"} key = "Up" func = "layoutswitch" cmd = "+" }
|
||||||
key { mod = {"Control"} key = "Down" func = "layoutswitch" cmd = "-" }
|
key { mod = {"Control"} key = "Down" func = "layoutswitch" cmd = "-" }
|
||||||
key { mod = {"Alt", "Shift"} key = "l" func = "set_mwfact" cmd = "+0.025" }
|
key { mod = {"Alt", "Shift"} key = "l" func = "set_mwfact" cmd = "+0.025" }
|
||||||
|
|||||||
Reference in New Issue
Block a user