Browse Source

fixed some issues due to the Arg->const char * transition

main
Anselm R. Garbe 17 years ago
parent
commit
825b7c3eb1
2 changed files with 10 additions and 9 deletions
  1. +9
    -9
      event.c
  2. +1
    -0
      layout.c

+ 9
- 9
event.c View File

@ -113,29 +113,29 @@ resizemouse(Client *c) {
static void static void
buttonpress(XEvent *e) { buttonpress(XEvent *e) {
static char arg[8];
int i, x;
static char buf[32];
unsigned int i, x;
Client *c; Client *c;
XButtonPressedEvent *ev = &e->xbutton; XButtonPressedEvent *ev = &e->xbutton;
arg[0] = 0;
buf[0] = 0;
if(barwin == ev->window) { if(barwin == ev->window) {
x = 0; x = 0;
for(i = 0; i < ntags; i++) { for(i = 0; i < ntags; i++) {
x += textw(tags[i]); x += textw(tags[i]);
if(ev->x < x) { if(ev->x < x) {
snprintf(arg, sizeof arg, "%d", i);
snprintf(buf, sizeof buf, "%d", i);
if(ev->button == Button1) { if(ev->button == Button1) {
if(ev->state & MODKEY) if(ev->state & MODKEY)
tag(arg);
tag(buf);
else else
view(arg);
view(buf);
} }
else if(ev->button == Button3) { else if(ev->button == Button3) {
if(ev->state & MODKEY) if(ev->state & MODKEY)
toggletag(arg);
toggletag(buf);
else else
toggleview(arg);
toggleview(buf);
} }
return; return;
} }
@ -143,7 +143,7 @@ buttonpress(XEvent *e) {
if(ev->x < x + blw) if(ev->x < x + blw)
switch(ev->button) { switch(ev->button) {
case Button1: case Button1:
setlayout("-1");
setlayout(NULL);
break; break;
} }
} }


+ 1
- 0
layout.c View File

@ -2,6 +2,7 @@
* See LICENSE file for license details. * See LICENSE file for license details.
*/ */
#include "dwm.h" #include "dwm.h"
#include <stdlib.h>
unsigned int blw = 0; unsigned int blw = 0;
Layout *lt = NULL; Layout *lt = NULL;


Loading…
Cancel
Save