[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 ALT Mod1Mask
|
||||||
#define SHIFT ShiftMask
|
#define SHIFT ShiftMask
|
||||||
#define LEN(x) (sizeof x / sizeof x[0])
|
#define LEN(x) (sizeof x / sizeof x[0])
|
||||||
|
#define ITOA(p,n) sprintf(p,"%i",n)
|
||||||
#define Move 0
|
#define Move 0
|
||||||
#define Resize 1
|
#define Resize 1
|
||||||
#define MAXTAG 36
|
#define MAXTAG 36
|
||||||
@ -131,10 +132,8 @@ void setborder(Window win, int color);
|
|||||||
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 tagn(int tag);
|
|
||||||
void tagswitch(char *cmd);
|
void tagswitch(char *cmd);
|
||||||
void tagtransfert(char *cmd);
|
void tagtransfert(char *cmd);
|
||||||
void tagtransfertn(int n);
|
|
||||||
void tile(char *cmd);
|
void tile(char *cmd);
|
||||||
void togglemax(char *cmd);
|
void togglemax(char *cmd);
|
||||||
void unhide(Client *c);
|
void unhide(Client *c);
|
||||||
|
|||||||
33
wmfs.c
33
wmfs.c
@ -136,6 +136,7 @@ getevent(void) {
|
|||||||
XWindowChanges wc;
|
XWindowChanges wc;
|
||||||
Client *c;
|
Client *c;
|
||||||
int i;
|
int i;
|
||||||
|
char s[6];
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
if(QLength(dpy) > 0) {
|
if(QLength(dpy) > 0) {
|
||||||
XNextEvent(dpy, &event);
|
XNextEvent(dpy, &event);
|
||||||
@ -247,11 +248,12 @@ getevent(void) {
|
|||||||
if(event.xbutton.x > taglen[i-1]
|
if(event.xbutton.x > taglen[i-1]
|
||||||
&& event.xbutton.x < taglen[i]) {
|
&& event.xbutton.x < taglen[i]) {
|
||||||
if(event.xbutton.button == Button1) {
|
if(event.xbutton.button == Button1) {
|
||||||
|
ITOA(s, i);
|
||||||
if(event.xbutton.state & ALT) {
|
if(event.xbutton.state & ALT) {
|
||||||
tagtransfertn(i);
|
tagtransfert(s);
|
||||||
updateall();
|
updateall();
|
||||||
}
|
}
|
||||||
tagn(i);
|
tag(s);
|
||||||
updateall();
|
updateall();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -749,22 +751,6 @@ tag(char *cmd) {
|
|||||||
return;
|
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
|
void
|
||||||
tagswitch(char *cmd) {
|
tagswitch(char *cmd) {
|
||||||
Client *c;
|
Client *c;
|
||||||
@ -799,17 +785,6 @@ tagtransfert(char *cmd) {
|
|||||||
unhide(sel);
|
unhide(sel);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
tagtransfertn(int n) {
|
|
||||||
if(!sel)
|
|
||||||
return;
|
|
||||||
sel->tag = n;
|
|
||||||
if(n != seltag)
|
|
||||||
hide(sel);
|
|
||||||
if(n == seltag)
|
|
||||||
unhide(sel);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
tile(char *cmd) {
|
tile(char *cmd) {
|
||||||
if(sel) {
|
if(sel) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user