188 /* bar */ |
188 /* bar */ |
189 dc.h = bh = dc.font.height + 2; |
189 dc.h = bh = dc.font.height + 2; |
190 wa.override_redirect = 1; |
190 wa.override_redirect = 1; |
191 wa.background_pixmap = ParentRelative; |
191 wa.background_pixmap = ParentRelative; |
192 wa.event_mask = ButtonPressMask | ExposureMask; |
192 wa.event_mask = ButtonPressMask | ExposureMask; |
193 barwin = XCreateWindow(dpy, root, sx, sy - bh, sw, bh, 0, |
193 barwin = XCreateWindow(dpy, root, sx, sy, sw, bh, 0, |
194 DefaultDepth(dpy, screen), CopyFromParent, DefaultVisual(dpy, screen), |
194 DefaultDepth(dpy, screen), CopyFromParent, DefaultVisual(dpy, screen), |
195 CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa); |
195 CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa); |
196 XDefineCursor(dpy, barwin, cursor[CurNormal]); |
196 XDefineCursor(dpy, barwin, cursor[CurNormal]); |
197 bpos = BARPOS; |
197 bpos = BARPOS; |
198 updatebarpos(); |
198 updatebarpos(); |
230 wax = sx; |
230 wax = sx; |
231 way = sy; |
231 way = sy; |
232 wah = sh; |
232 wah = sh; |
233 waw = sw; |
233 waw = sw; |
234 switch(bpos) { |
234 switch(bpos) { |
235 case BarTop: |
235 default: |
236 wah -= bh; |
236 wah -= bh; |
237 way += bh; |
237 way += bh; |
238 XMoveWindow(dpy, barwin, sx, sy); |
238 XMoveWindow(dpy, barwin, sx, sy); |
239 break; |
239 break; |
240 case BarBot: |
240 case BarBot: |
241 wah -= bh; |
241 wah -= bh; |
242 XMoveWindow(dpy, barwin, sx, sy + wah); |
242 XMoveWindow(dpy, barwin, sx, sy + wah); |
243 break; |
243 break; |
244 case BarOff: |
244 case BarOff: |
245 XMoveWindow(dpy, barwin, sx, sy - bh); |
245 XMoveWindow(dpy, barwin, sx, sy - bh); |
246 } |
246 break; |
247 lt->arrange(); |
247 } |
248 } |
248 } |
249 |
249 |
250 /* There's no way to check accesses to destroyed windows, thus those cases are |
250 /* There's no way to check accesses to destroyed windows, thus those cases are |
251 * ignored (especially on UnmapNotify's). Other types of errors call Xlibs |
251 * ignored (especially on UnmapNotify's). Other types of errors call Xlibs |
252 * default error handler, which may call exit. |
252 * default error handler, which may call exit. |