dwm.c
changeset 1124 160af328ab51
parent 1123 76f6c8659f40
child 1127 f861152c5708
equal deleted inserted replaced
1123:76f6c8659f40 1124:160af328ab51
   181 void viewprevtag(const char *arg);	/* views previous selected tags */
   181 void viewprevtag(const char *arg);	/* views previous selected tags */
   182 int xerror(Display *dpy, XErrorEvent *ee);
   182 int xerror(Display *dpy, XErrorEvent *ee);
   183 int xerrordummy(Display *dpy, XErrorEvent *ee);
   183 int xerrordummy(Display *dpy, XErrorEvent *ee);
   184 int xerrorstart(Display *dpy, XErrorEvent *ee);
   184 int xerrorstart(Display *dpy, XErrorEvent *ee);
   185 void zoom(const char *arg);
   185 void zoom(const char *arg);
   186 void selectview(const char *arg);
       
   187 
   186 
   188 /* variables */
   187 /* variables */
   189 char stext[256], buf[256];
   188 char stext[256], buf[256];
   190 double mwfact;
       
   191 int screen, sx, sy, sw, sh;
   189 int screen, sx, sy, sw, sh;
   192 int (*xerrorxlib)(Display *, XErrorEvent *);
   190 int (*xerrorxlib)(Display *, XErrorEvent *);
   193 unsigned int bh, bpos;
   191 unsigned int bh, blw = 0;
   194 unsigned int blw = 0;
       
   195 unsigned int numlockmask = 0;
   192 unsigned int numlockmask = 0;
   196 void (*handler[LASTEvent]) (XEvent *) = {
   193 void (*handler[LASTEvent]) (XEvent *) = {
   197 	[ButtonPress] = buttonpress,
   194 	[ButtonPress] = buttonpress,
   198 	[ConfigureRequest] = configurerequest,
   195 	[ConfigureRequest] = configurerequest,
   199 	[ConfigureNotify] = configurenotify,
   196 	[ConfigureNotify] = configurenotify,
   217 Client *sel = NULL;
   214 Client *sel = NULL;
   218 Client *stack = NULL;
   215 Client *stack = NULL;
   219 Cursor cursor[CurLast];
   216 Cursor cursor[CurLast];
   220 Display *dpy;
   217 Display *dpy;
   221 DC dc = {0};
   218 DC dc = {0};
   222 Layout *lt;
   219 Layout *lt = NULL;
   223 Window root, barwin;
   220 Window root, barwin;
   224 
   221 
   225 /* configuration, allows nested code to access above variables */
   222 /* configuration, allows nested code to access above variables */
   226 #include "config.h"
   223 #include "config.h"
   227 #define TAGSZ (LENGTH(tags) * sizeof(Bool))
   224 #define TAGSZ (LENGTH(tags) * sizeof(Bool))
   360 	XSync(dpy, False);
   357 	XSync(dpy, False);
   361 }
   358 }
   362 
   359 
   363 void
   360 void
   364 cleanup(void) {
   361 cleanup(void) {
   365 
       
   366 	close(STDIN_FILENO);
   362 	close(STDIN_FILENO);
   367 	while(stack) {
   363 	while(stack) {
   368 		unban(stack);
   364 		unban(stack);
   369 		unmanage(stack);
   365 		unmanage(stack);
   370 	}
   366 	}
   371 	if(dc.font.set)
   367 	if(dc.font.set)
   372 		XFreeFontSet(dpy, dc.font.set);
   368 		XFreeFontSet(dpy, dc.font.set);
   373 	else
   369 	else
   374 		XFreeFont(dpy, dc.font.xfont);
   370 		XFreeFont(dpy, dc.font.xfont);
   375 
       
   376 	XUngrabKey(dpy, AnyKey, AnyModifier, root);
   371 	XUngrabKey(dpy, AnyKey, AnyModifier, root);
   377 	XFreePixmap(dpy, dc.drawable);
   372 	XFreePixmap(dpy, dc.drawable);
   378 	XFreeGC(dpy, dc.gc);
   373 	XFreeGC(dpy, dc.gc);
   379 	XFreeCursor(dpy, cursor[CurNormal]);
   374 	XFreeCursor(dpy, cursor[CurNormal]);
   380 	XFreeCursor(dpy, cursor[CurResize]);
   375 	XFreeCursor(dpy, cursor[CurResize]);