X-Git-Url: https://git.xinqibao.xyz/dwm.git/blobdiff_plain/2c6be7239f932121b9e4526b01b957fcefc8345a..f2512243f494915fe91ebb5e67ac94abd5b528c6:/main.c diff --git a/main.c b/main.c index 032fafa..2140d89 100644 --- a/main.c +++ b/main.c @@ -16,8 +16,10 @@ char stext[256]; int screen, sx, sy, sw, sh, wax, way, waw, wah; -unsigned int bh, bpos, ntags, numlockmask; -Atom wmatom[WMLast], netatom[NetLast]; +unsigned int bh, ntags; +unsigned int bpos = BARPOS; +unsigned int numlockmask = 0; +Atom dwmtags, wmatom[WMLast], netatom[NetLast]; Bool *seltag; Bool selscreen = True; Client *clients = NULL; @@ -38,8 +40,7 @@ static void cleanup(void) { close(STDIN_FILENO); while(stack) { - if(stack->isbanned) - XMoveWindow(dpy, stack->win, stack->x, stack->y); + unban(stack); unmanage(stack); } if(dc.font.set) @@ -138,6 +139,7 @@ setup(void) { XSetWindowAttributes wa; /* init atoms */ + dwmtags = XInternAtom(dpy, "__DWM_TAGS", False); wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False); wmatom[WMDelete] = XInternAtom(dpy, "WM_DELETE_WINDOW", False); wmatom[WMState] = XInternAtom(dpy, "WM_STATE", False); @@ -150,7 +152,6 @@ setup(void) { cursor[CurResize] = XCreateFontCursor(dpy, XC_sizing); cursor[CurMove] = XCreateFontCursor(dpy, XC_fleur); /* init modifier map */ - numlockmask = 0; modmap = XGetModifierMapping(dpy); for (i = 0; i < 8; i++) for (j = 0; j < modmap->max_keypermod; j++) { @@ -192,7 +193,6 @@ setup(void) { DefaultDepth(dpy, screen), CopyFromParent, DefaultVisual(dpy, screen), CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa); XDefineCursor(dpy, barwin, cursor[CurNormal]); - bpos = BARPOS; updatebarpos(); XMapRaised(dpy, barwin); strcpy(stext, "dwm-"VERSION);