[wmfs.c local.h] Remove 2 stupid function && Add clever macro
This commit is contained in:
parent
00133aed50
commit
762f2f1e9a
3
local.h
3
local.h
@ -32,6 +32,7 @@
|
||||
#define ALT Mod1Mask
|
||||
#define SHIFT ShiftMask
|
||||
#define LEN(x) (sizeof x / sizeof x[0])
|
||||
#define ITOA(p,n) sprintf(p,"%i",n)
|
||||
#define Move 0
|
||||
#define Resize 1
|
||||
#define MAXTAG 36
|
||||
@ -131,10 +132,8 @@ void setborder(Window win, int color);
|
||||
void setsizehints(Client *c);
|
||||
void spawn(char *cmd);
|
||||
void tag(char *cmd);
|
||||
void tagn(int tag);
|
||||
void tagswitch(char *cmd);
|
||||
void tagtransfert(char *cmd);
|
||||
void tagtransfertn(int n);
|
||||
void tile(char *cmd);
|
||||
void togglemax(char *cmd);
|
||||
void unhide(Client *c);
|
||||
|
||||
33
wmfs.c
33
wmfs.c
@ -136,6 +136,7 @@ getevent(void) {
|
||||
XWindowChanges wc;
|
||||
Client *c;
|
||||
int i;
|
||||
char s[6];
|
||||
struct timeval tv;
|
||||
if(QLength(dpy) > 0) {
|
||||
XNextEvent(dpy, &event);
|
||||
@ -247,11 +248,12 @@ getevent(void) {
|
||||
if(event.xbutton.x > taglen[i-1]
|
||||
&& event.xbutton.x < taglen[i]) {
|
||||
if(event.xbutton.button == Button1) {
|
||||
ITOA(s, i);
|
||||
if(event.xbutton.state & ALT) {
|
||||
tagtransfertn(i);
|
||||
tagtransfert(s);
|
||||
updateall();
|
||||
}
|
||||
tagn(i);
|
||||
tag(s);
|
||||
updateall();
|
||||
}
|
||||
}
|
||||
@ -749,22 +751,6 @@ tag(char *cmd) {
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
tagn(int tag) {
|
||||
Client *c;
|
||||
if(tag > conf.ntag || tag < 1 || tag == seltag)
|
||||
return;
|
||||
for(c = clients; c; c = c->next) {
|
||||
if(!ishide(c))
|
||||
hide(c);
|
||||
if(c->tag == tag)
|
||||
unhide(c);
|
||||
}
|
||||
seltag = tag;
|
||||
sel = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
tagswitch(char *cmd) {
|
||||
Client *c;
|
||||
@ -799,17 +785,6 @@ tagtransfert(char *cmd) {
|
||||
unhide(sel);
|
||||
}
|
||||
|
||||
void
|
||||
tagtransfertn(int n) {
|
||||
if(!sel)
|
||||
return;
|
||||
sel->tag = n;
|
||||
if(n != seltag)
|
||||
hide(sel);
|
||||
if(n == seltag)
|
||||
unhide(sel);
|
||||
}
|
||||
|
||||
void
|
||||
tile(char *cmd) {
|
||||
if(sel) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user