moved updatebarpos to screen
b975c472
3 file(s) · +28 −28
| 117 | 117 | /* main.c */ |
|
| 118 | 118 | Bool gettextprop(Window w, Atom atom, |
|
| 119 | 119 | char *text, unsigned int size); /* return text property, UTF-8 compliant */ |
|
| 120 | - | void updatebarpos(void); /* updates the bar position */ |
|
| 121 | - | void quit(const char *arg); /* quit dwm nicely */ |
|
| 120 | + | void quit(const char *arg); /* quit dwm nicely */ |
|
| 122 | 121 | int xerror(Display *dsply, XErrorEvent *ee); /* dwm's X error handler */ |
|
| 123 | 122 | ||
| 124 | 123 | /* screen.c */ |
|
| 142 | 141 | void togglemax(const char *arg); /* toggles maximization of floating client */ |
|
| 143 | 142 | void toggletag(const char *arg); /* toggles sel tags with arg's index */ |
|
| 144 | 143 | void toggleview(const char *arg); /* toggles the tag with arg's index (in)visible */ |
|
| 144 | + | void updatebarpos(void); /* updates the bar position */ |
|
| 145 | 145 | void view(const char *arg); /* views the tag with arg's index */ |
|
| 146 | 146 | ||
| 147 | 147 | /* util.c */ |
|
| 253 | 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 | 256 | /* There's no way to check accesses to destroyed windows, thus those cases are |
|
| 283 | 257 | * ignored (especially on UnmapNotify's). Other types of errors call Xlibs |
|
| 284 | 258 | * default error handler, which may call exit. |
| 370 | 370 | } |
|
| 371 | 371 | ||
| 372 | 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 | 399 | view(const char *arg) { |
|
| 374 | 400 | unsigned int i; |
|
| 375 | 401 |