diff options
| author | Anselm R. Garbe <garbeam@gmail.com> | 2007-08-19 11:00:47 +0200 |
|---|---|---|
| committer | Anselm R. Garbe <garbeam@gmail.com> | 2007-08-19 11:00:47 +0200 |
| commit | b975c4728046052a32626378df193217a96fbefc (patch) | |
| tree | e299b09d2cf9c1853a34531fd9f6d0cb20ad8da0 | |
| parent | added screen.c, removed layout.c and tag.c (diff) | |
| download | dwm-b975c4728046052a32626378df193217a96fbefc.tar.gz dwm-b975c4728046052a32626378df193217a96fbefc.zip | |
moved updatebarpos to screen
Diffstat (limited to '')
| -rw-r--r-- | dwm.h | 4 | ||||
| -rw-r--r-- | main.c | 26 | ||||
| -rw-r--r-- | screen.c | 26 |
3 files changed, 28 insertions, 28 deletions
| @@ -117,8 +117,7 @@ void grabkeys(void); /* grab all keys defined in config.h */ | |||
| 117 | /* main.c */ | 117 | /* main.c */ |
| 118 | Bool gettextprop(Window w, Atom atom, | 118 | Bool gettextprop(Window w, Atom atom, |
| 119 | char *text, unsigned int size); /* return text property, UTF-8 compliant */ | 119 | char *text, unsigned int size); /* return text property, UTF-8 compliant */ |
| 120 | void updatebarpos(void); /* updates the bar position */ | 120 | void quit(const char *arg); /* quit dwm nicely */ |
| 121 | void quit(const char *arg); /* quit dwm nicely */ | ||
| 122 | int xerror(Display *dsply, XErrorEvent *ee); /* dwm's X error handler */ | 121 | int xerror(Display *dsply, XErrorEvent *ee); /* dwm's X error handler */ |
| 123 | 122 | ||
| 124 | /* screen.c */ | 123 | /* screen.c */ |
| @@ -142,6 +141,7 @@ void togglefloating(const char *arg); /* toggles sel between floating/tiled stat | |||
| 142 | void togglemax(const char *arg); /* toggles maximization of floating client */ | 141 | void togglemax(const char *arg); /* toggles maximization of floating client */ |
| 143 | void toggletag(const char *arg); /* toggles sel tags with arg's index */ | 142 | void toggletag(const char *arg); /* toggles sel tags with arg's index */ |
| 144 | void toggleview(const char *arg); /* toggles the tag with arg's index (in)visible */ | 143 | void toggleview(const char *arg); /* toggles the tag with arg's index (in)visible */ |
| 144 | void updatebarpos(void); /* updates the bar position */ | ||
| 145 | void view(const char *arg); /* views the tag with arg's index */ | 145 | void view(const char *arg); /* views the tag with arg's index */ |
| 146 | 146 | ||
| 147 | /* util.c */ | 147 | /* util.c */ |
| @@ -253,32 +253,6 @@ quit(const char *arg) { | |||
| 253 | readin = running = False; | 253 | readin = running = False; |
| 254 | } | 254 | } |
| 255 | 255 | ||
| 256 | void | ||
| 257 | updatebarpos(void) { | ||
| 258 | XEvent ev; | ||
| 259 | |||
| 260 | wax = sx; | ||
| 261 | way = sy; | ||
| 262 | wah = sh; | ||
| 263 | waw = sw; | ||
| 264 | switch(bpos) { | ||
| 265 | default: | ||
| 266 | wah -= bh; | ||
| 267 | way += bh; | ||
| 268 | XMoveWindow(dpy, barwin, sx, sy); | ||
| 269 | break; | ||
| 270 | case BarBot: | ||
| 271 | wah -= bh; | ||
| 272 | XMoveWindow(dpy, barwin, sx, sy + wah); | ||
| 273 | break; | ||
| 274 | case BarOff: | ||
| 275 | XMoveWindow(dpy, barwin, sx, sy - bh); | ||
| 276 | break; | ||
| 277 | } | ||
| 278 | XSync(dpy, False); | ||
| 279 | while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); | ||
| 280 | } | ||
| 281 | |||
| 282 | /* There's no way to check accesses to destroyed windows, thus those cases are | 256 | /* There's no way to check accesses to destroyed windows, thus those cases are |
| 283 | * ignored (especially on UnmapNotify's). Other types of errors call Xlibs | 257 | * ignored (especially on UnmapNotify's). Other types of errors call Xlibs |
| 284 | * default error handler, which may call exit. | 258 | * default error handler, which may call exit. |
| @@ -370,6 +370,32 @@ toggleview(const char *arg) { | |||
| 370 | } | 370 | } |
| 371 | 371 | ||
| 372 | void | 372 | void |
| 373 | updatebarpos(void) { | ||
| 374 | XEvent ev; | ||
| 375 | |||
| 376 | wax = sx; | ||
| 377 | way = sy; | ||
| 378 | wah = sh; | ||
| 379 | waw = sw; | ||
| 380 | switch(bpos) { | ||
| 381 | default: | ||
| 382 | wah -= bh; | ||
| 383 | way += bh; | ||
| 384 | XMoveWindow(dpy, barwin, sx, sy); | ||
| 385 | break; | ||
| 386 | case BarBot: | ||
| 387 | wah -= bh; | ||
| 388 | XMoveWindow(dpy, barwin, sx, sy + wah); | ||
| 389 | break; | ||
| 390 | case BarOff: | ||
| 391 | XMoveWindow(dpy, barwin, sx, sy - bh); | ||
| 392 | break; | ||
| 393 | } | ||
| 394 | XSync(dpy, False); | ||
| 395 | while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); | ||
| 396 | } | ||
| 397 | |||
| 398 | void | ||
| 373 | view(const char *arg) { | 399 | view(const char *arg) { |
| 374 | unsigned int i; | 400 | unsigned int i; |
| 375 | 401 | ||
