summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--main.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/main.c b/main.c
index b96157c..935d860 100644
--- a/main.c
+++ b/main.c
@@ -16,10 +16,10 @@
16 16
17Display *dpy; 17Display *dpy;
18Window root, barwin; 18Window root, barwin;
19Atom wm_atom[WMLast], net_atom[NetLast]; 19Atom wmatom[WMLast], netatom[NetLast];
20Cursor cursor[CurLast]; 20Cursor cursor[CurLast];
21Bool running = True; 21Bool running = True;
22Bool issel; 22Bool issel = True;
23 23
24int tsel = Tdev; /* default tag */ 24int tsel = Tdev; /* default tag */
25int screen, sx, sy, sw, sh, bx, by, bw, bh, mw; 25int screen, sx, sy, sw, sh, bx, by, bw, bh, mw;
@@ -30,8 +30,6 @@ Client *clients = NULL;
30Client *sel = NULL; 30Client *sel = NULL;
31 31
32static Bool otherwm; 32static Bool otherwm;
33static const char version[] =
34 "dwm-" VERSION ", (C)opyright MMVI Anselm R. Garbe\n";
35static int (*xerrorxlib)(Display *, XErrorEvent *); 33static int (*xerrorxlib)(Display *, XErrorEvent *);
36 34
37/* static functions */ 35/* static functions */
@@ -109,12 +107,12 @@ getproto(Window w)
109 int protos = 0; 107 int protos = 0;
110 int i; 108 int i;
111 109
112 res = win_property(w, wm_atom[WMProtocols], XA_ATOM, 20L, &protocols); 110 res = win_property(w, wmatom[WMProtocols], XA_ATOM, 20L, &protocols);
113 if(res <= 0) { 111 if(res <= 0) {
114 return protos; 112 return protos;
115 } 113 }
116 for(i = 0; i < res; i++) { 114 for(i = 0; i < res; i++) {
117 if(protocols[i] == wm_atom[WMDelete]) 115 if(protocols[i] == wmatom[WMDelete])
118 protos |= WM_PROTOCOL_DELWIN; 116 protos |= WM_PROTOCOL_DELWIN;
119 } 117 }
120 free((char *) protocols); 118 free((char *) protocols);
@@ -184,7 +182,8 @@ main(int argc, char *argv[])
184 for(i = 1; (i < argc) && (argv[i][0] == '-'); i++) { 182 for(i = 1; (i < argc) && (argv[i][0] == '-'); i++) {
185 switch (argv[i][1]) { 183 switch (argv[i][1]) {
186 case 'v': 184 case 'v':
187 fprintf(stdout, "%s", version); 185 fprintf(stdout, "%s",
186 "dwm-"VERSION", (C)opyright MMVI Anselm R. Garbe\n");
188 exit(0); 187 exit(0);
189 break; 188 break;
190 default: 189 default:
@@ -214,12 +213,12 @@ main(int argc, char *argv[])
214 xerrorxlib = XSetErrorHandler(xerror); 213 xerrorxlib = XSetErrorHandler(xerror);
215 214
216 /* init atoms */ 215 /* init atoms */
217 wm_atom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False); 216 wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False);
218 wm_atom[WMDelete] = XInternAtom(dpy, "WM_DELETE_WINDOW", False); 217 wmatom[WMDelete] = XInternAtom(dpy, "WM_DELETE_WINDOW", False);
219 net_atom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False); 218 netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False);
220 net_atom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False); 219 netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False);
221 XChangeProperty(dpy, root, net_atom[NetSupported], XA_ATOM, 32, 220 XChangeProperty(dpy, root, netatom[NetSupported], XA_ATOM, 32,
222 PropModeReplace, (unsigned char *) net_atom, NetLast); 221 PropModeReplace, (unsigned char *) netatom, NetLast);
223 222
224 /* init cursors */ 223 /* init cursors */
225 cursor[CurNormal] = XCreateFontCursor(dpy, XC_left_ptr); 224 cursor[CurNormal] = XCreateFontCursor(dpy, XC_left_ptr);