[wmfs.c] Fix segfault
This commit is contained in:
26
wmfs.c
26
wmfs.c
@@ -45,10 +45,24 @@ buttonpress(XEvent *event) {
|
|||||||
char s[6];
|
char s[6];
|
||||||
XButtonPressedEvent *ev = &event->xbutton;
|
XButtonPressedEvent *ev = &event->xbutton;
|
||||||
|
|
||||||
/* Window and Tbar */
|
/* Tbar'n'Button */
|
||||||
/* move, resize and toggle max */
|
if(conf.ttbarheight) {
|
||||||
if((c = gettbar(ev->window))
|
if((c = gettbar(ev->window))) {
|
||||||
|| (c = getclient(ev->window))) {
|
if(ev->button == Button1)
|
||||||
|
mouseaction(c, ev->x_root, ev->y_root, Move); /* type 0 for move */
|
||||||
|
else if(ev->button == Button2)
|
||||||
|
tile_switch(NULL);
|
||||||
|
else if(ev->button == Button3)
|
||||||
|
mouseaction(c, ev->x_root, ev->y_root, Resize); /* type 1 for resize */
|
||||||
|
} else if((c = getbutton(ev->window))) {
|
||||||
|
if(ev->button == Button1)
|
||||||
|
killclient(NULL);
|
||||||
|
else if(ev->button == Button3)
|
||||||
|
togglemax(NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* Window */
|
||||||
|
if((c = getclient(ev->window))) {
|
||||||
raiseclient(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 */
|
||||||
@@ -58,13 +72,13 @@ buttonpress(XEvent *event) {
|
|||||||
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 */
|
||||||
}
|
}
|
||||||
/* Button */
|
/* Button */
|
||||||
/* for kill and togglemax the sel client */
|
/* for kill and togglemax the sel client
|
||||||
else if((c = getbutton(ev->window))) {
|
else if((c = getbutton(ev->window))) {
|
||||||
if(ev->button == Button1)
|
if(ev->button == Button1)
|
||||||
killclient(NULL);
|
killclient(NULL);
|
||||||
else if(ev->button == Button3)
|
else if(ev->button == Button3)
|
||||||
togglemax(NULL);
|
togglemax(NULL);
|
||||||
}
|
} */
|
||||||
/* Bar */
|
/* Bar */
|
||||||
/* for tag click */
|
/* for tag click */
|
||||||
else if(ev->window == bar) {
|
else if(ev->window == bar) {
|
||||||
|
|||||||
Reference in New Issue
Block a user