main.c
changeset 917 434e10a35d3c
parent 914 dad36921af06
child 949 99ee5c370f94
equal deleted inserted replaced
916:b0dfa4fe6c63 917:434e10a35d3c
    14 
    14 
    15 /* extern */
    15 /* extern */
    16 
    16 
    17 char stext[256];
    17 char stext[256];
    18 int screen, sx, sy, sw, sh, wax, way, waw, wah;
    18 int screen, sx, sy, sw, sh, wax, way, waw, wah;
    19 unsigned int bh, bpos, ntags, numlockmask;
    19 unsigned int bh, ntags;
       
    20 unsigned int bpos = BARPOS;
       
    21 unsigned int numlockmask = 0;
    20 Atom wmatom[WMLast], netatom[NetLast];
    22 Atom wmatom[WMLast], netatom[NetLast];
    21 Bool *seltag;
    23 Bool *seltag;
    22 Bool selscreen = True;
    24 Bool selscreen = True;
    23 Client *clients = NULL;
    25 Client *clients = NULL;
    24 Client *sel = NULL;
    26 Client *sel = NULL;
   147 	/* init cursors */
   149 	/* init cursors */
   148 	cursor[CurNormal] = XCreateFontCursor(dpy, XC_left_ptr);
   150 	cursor[CurNormal] = XCreateFontCursor(dpy, XC_left_ptr);
   149 	cursor[CurResize] = XCreateFontCursor(dpy, XC_sizing);
   151 	cursor[CurResize] = XCreateFontCursor(dpy, XC_sizing);
   150 	cursor[CurMove] = XCreateFontCursor(dpy, XC_fleur);
   152 	cursor[CurMove] = XCreateFontCursor(dpy, XC_fleur);
   151 	/* init modifier map */
   153 	/* init modifier map */
   152 	numlockmask = 0;
       
   153 	modmap = XGetModifierMapping(dpy);
   154 	modmap = XGetModifierMapping(dpy);
   154 	for (i = 0; i < 8; i++)
   155 	for (i = 0; i < 8; i++)
   155 		for (j = 0; j < modmap->max_keypermod; j++) {
   156 		for (j = 0; j < modmap->max_keypermod; j++) {
   156 			if(modmap->modifiermap[i * modmap->max_keypermod + j]
   157 			if(modmap->modifiermap[i * modmap->max_keypermod + j]
   157 					== XKeysymToKeycode(dpy, XK_Num_Lock))
   158 					== XKeysymToKeycode(dpy, XK_Num_Lock))
   189 	wa.event_mask = ButtonPressMask | ExposureMask;
   190 	wa.event_mask = ButtonPressMask | ExposureMask;
   190 	barwin = XCreateWindow(dpy, root, sx, sy, sw, bh, 0,
   191 	barwin = XCreateWindow(dpy, root, sx, sy, sw, bh, 0,
   191 			DefaultDepth(dpy, screen), CopyFromParent, DefaultVisual(dpy, screen),
   192 			DefaultDepth(dpy, screen), CopyFromParent, DefaultVisual(dpy, screen),
   192 			CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa);
   193 			CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa);
   193 	XDefineCursor(dpy, barwin, cursor[CurNormal]);
   194 	XDefineCursor(dpy, barwin, cursor[CurNormal]);
   194 	bpos = BARPOS;
       
   195 	updatebarpos();
   195 	updatebarpos();
   196 	XMapRaised(dpy, barwin);
   196 	XMapRaised(dpy, barwin);
   197 	strcpy(stext, "dwm-"VERSION);
   197 	strcpy(stext, "dwm-"VERSION);
   198 	/* pixmap for everything */
   198 	/* pixmap for everything */
   199 	dc.drawable = XCreatePixmap(dpy, root, sw, bh, DefaultDepth(dpy, screen));
   199 	dc.drawable = XCreatePixmap(dpy, root, sw, bh, DefaultDepth(dpy, screen));