diff options
| author | Anselm R. Garbe <arg@suckless.org> | 2007-02-22 12:00:02 +0100 |
|---|---|---|
| committer | Anselm R. Garbe <arg@suckless.org> | 2007-02-22 12:00:02 +0100 |
| commit | 825b7c3eb17fd0a79005110bf28e92c4ed2f1a90 (patch) | |
| tree | e3022bcaa8905768fcc82ed881d9d7a1a629ec00 | |
| parent | restoring default keybindings as Sander complained (diff) | |
| download | dwm-825b7c3eb17fd0a79005110bf28e92c4ed2f1a90.tar.gz dwm-825b7c3eb17fd0a79005110bf28e92c4ed2f1a90.zip | |
fixed some issues due to the Arg->const char * transition
| -rw-r--r-- | event.c | 18 | ||||
| -rw-r--r-- | layout.c | 1 |
2 files changed, 10 insertions, 9 deletions
| @@ -113,29 +113,29 @@ resizemouse(Client *c) { | |||
| 113 | 113 | ||
| 114 | static void | 114 | static void |
| 115 | buttonpress(XEvent *e) { | 115 | buttonpress(XEvent *e) { |
| 116 | static char arg[8]; | 116 | static char buf[32]; |
| 117 | int i, x; | 117 | unsigned int i, x; |
| 118 | Client *c; | 118 | Client *c; |
| 119 | XButtonPressedEvent *ev = &e->xbutton; | 119 | XButtonPressedEvent *ev = &e->xbutton; |
| 120 | 120 | ||
| 121 | arg[0] = 0; | 121 | buf[0] = 0; |
| 122 | if(barwin == ev->window) { | 122 | if(barwin == ev->window) { |
| 123 | x = 0; | 123 | x = 0; |
| 124 | for(i = 0; i < ntags; i++) { | 124 | for(i = 0; i < ntags; i++) { |
| 125 | x += textw(tags[i]); | 125 | x += textw(tags[i]); |
| 126 | if(ev->x < x) { | 126 | if(ev->x < x) { |
| 127 | snprintf(arg, sizeof arg, "%d", i); | 127 | snprintf(buf, sizeof buf, "%d", i); |
| 128 | if(ev->button == Button1) { | 128 | if(ev->button == Button1) { |
| 129 | if(ev->state & MODKEY) | 129 | if(ev->state & MODKEY) |
| 130 | tag(arg); | 130 | tag(buf); |
| 131 | else | 131 | else |
| 132 | view(arg); | 132 | view(buf); |
| 133 | } | 133 | } |
| 134 | else if(ev->button == Button3) { | 134 | else if(ev->button == Button3) { |
| 135 | if(ev->state & MODKEY) | 135 | if(ev->state & MODKEY) |
| 136 | toggletag(arg); | 136 | toggletag(buf); |
| 137 | else | 137 | else |
| 138 | toggleview(arg); | 138 | toggleview(buf); |
| 139 | } | 139 | } |
| 140 | return; | 140 | return; |
| 141 | } | 141 | } |
| @@ -143,7 +143,7 @@ buttonpress(XEvent *e) { | |||
| 143 | if(ev->x < x + blw) | 143 | if(ev->x < x + blw) |
| 144 | switch(ev->button) { | 144 | switch(ev->button) { |
| 145 | case Button1: | 145 | case Button1: |
| 146 | setlayout("-1"); | 146 | setlayout(NULL); |
| 147 | break; | 147 | break; |
| 148 | } | 148 | } |
| 149 | } | 149 | } |
| @@ -2,6 +2,7 @@ | |||
| 2 | * See LICENSE file for license details. | 2 | * See LICENSE file for license details. |
| 3 | */ | 3 | */ |
| 4 | #include "dwm.h" | 4 | #include "dwm.h" |
| 5 | #include <stdlib.h> | ||
| 5 | 6 | ||
| 6 | unsigned int blw = 0; | 7 | unsigned int blw = 0; |
| 7 | Layout *lt = NULL; | 8 | Layout *lt = NULL; |
