diff options
Diffstat (limited to '')
| -rw-r--r-- | main.c | 25 |
1 files changed, 12 insertions, 13 deletions
| @@ -16,10 +16,10 @@ | |||
| 16 | 16 | ||
| 17 | Display *dpy; | 17 | Display *dpy; |
| 18 | Window root, barwin; | 18 | Window root, barwin; |
| 19 | Atom wm_atom[WMLast], net_atom[NetLast]; | 19 | Atom wmatom[WMLast], netatom[NetLast]; |
| 20 | Cursor cursor[CurLast]; | 20 | Cursor cursor[CurLast]; |
| 21 | Bool running = True; | 21 | Bool running = True; |
| 22 | Bool issel; | 22 | Bool issel = True; |
| 23 | 23 | ||
| 24 | int tsel = Tdev; /* default tag */ | 24 | int tsel = Tdev; /* default tag */ |
| 25 | int screen, sx, sy, sw, sh, bx, by, bw, bh, mw; | 25 | int screen, sx, sy, sw, sh, bx, by, bw, bh, mw; |
| @@ -30,8 +30,6 @@ Client *clients = NULL; | |||
| 30 | Client *sel = NULL; | 30 | Client *sel = NULL; |
| 31 | 31 | ||
| 32 | static Bool otherwm; | 32 | static Bool otherwm; |
| 33 | static const char version[] = | ||
| 34 | "dwm-" VERSION ", (C)opyright MMVI Anselm R. Garbe\n"; | ||
| 35 | static int (*xerrorxlib)(Display *, XErrorEvent *); | 33 | static 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); |
