191 void zoom(const void *arg); |
191 void zoom(const void *arg); |
192 |
192 |
193 /* variables */ |
193 /* variables */ |
194 char stext[256]; |
194 char stext[256]; |
195 int screen, sx, sy, sw, sh; |
195 int screen, sx, sy, sw, sh; |
196 int bx, by, bw, bh, blw, wx, wy, ww, wh; |
196 int by, bh, blw, wx, wy, ww, wh; |
197 uint seltags = 0; |
197 uint seltags = 0; |
198 int (*xerrorxlib)(Display *, XErrorEvent *); |
198 int (*xerrorxlib)(Display *, XErrorEvent *); |
199 uint numlockmask = 0; |
199 uint numlockmask = 0; |
200 void (*handler[LASTEvent]) (XEvent *) = { |
200 void (*handler[LASTEvent]) (XEvent *) = { |
201 [ButtonPress] = buttonpress, |
201 [ButtonPress] = buttonpress, |
519 drawsquare(False, c->isfloating, False, dc.sel); |
519 drawsquare(False, c->isfloating, False, dc.sel); |
520 } |
520 } |
521 else |
521 else |
522 drawtext(NULL, dc.norm, False); |
522 drawtext(NULL, dc.norm, False); |
523 } |
523 } |
524 XCopyArea(dpy, dc.drawable, barwin, dc.gc, 0, 0, bw, bh, 0, 0); |
524 XCopyArea(dpy, dc.drawable, barwin, dc.gc, 0, 0, ww, bh, 0, 0); |
525 XSync(dpy, False); |
525 XSync(dpy, False); |
526 } |
526 } |
527 |
527 |
528 void |
528 void |
529 drawsquare(Bool filled, Bool empty, Bool invert, ulong col[ColLast]) { |
529 drawsquare(Bool filled, Bool empty, Bool invert, ulong col[ColLast]) { |
1370 |
1370 |
1371 wa.override_redirect = 1; |
1371 wa.override_redirect = 1; |
1372 wa.background_pixmap = ParentRelative; |
1372 wa.background_pixmap = ParentRelative; |
1373 wa.event_mask = ButtonPressMask|ExposureMask; |
1373 wa.event_mask = ButtonPressMask|ExposureMask; |
1374 |
1374 |
1375 barwin = XCreateWindow(dpy, root, bx, by, bw, bh, 0, DefaultDepth(dpy, screen), |
1375 barwin = XCreateWindow(dpy, root, wx, by, ww, bh, 0, DefaultDepth(dpy, screen), |
1376 CopyFromParent, DefaultVisual(dpy, screen), |
1376 CopyFromParent, DefaultVisual(dpy, screen), |
1377 CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa); |
1377 CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa); |
1378 XDefineCursor(dpy, barwin, cursor[CurNormal]); |
1378 XDefineCursor(dpy, barwin, cursor[CurNormal]); |
1379 XMapRaised(dpy, barwin); |
1379 XMapRaised(dpy, barwin); |
1380 strcpy(stext, "dwm-"VERSION); |
1380 strcpy(stext, "dwm-"VERSION); |
1565 |
1565 |
1566 void |
1566 void |
1567 updatebar(void) { |
1567 updatebar(void) { |
1568 if(dc.drawable != 0) |
1568 if(dc.drawable != 0) |
1569 XFreePixmap(dpy, dc.drawable); |
1569 XFreePixmap(dpy, dc.drawable); |
1570 dc.drawable = XCreatePixmap(dpy, root, bw, bh, DefaultDepth(dpy, screen)); |
1570 dc.drawable = XCreatePixmap(dpy, root, ww, bh, DefaultDepth(dpy, screen)); |
1571 XMoveResizeWindow(dpy, barwin, bx, by, bw, bh); |
1571 XMoveResizeWindow(dpy, barwin, wx, by, ww, bh); |
1572 } |
1572 } |
1573 |
1573 |
1574 void |
1574 void |
1575 updategeom(void) { |
1575 updategeom(void) { |
1576 int i; |
1576 int i; |