diff options
| author | Anselm R. Garbe <garbeam@gmail.com> | 2007-08-19 10:40:07 +0200 |
|---|---|---|
| committer | Anselm R. Garbe <garbeam@gmail.com> | 2007-08-19 10:40:07 +0200 |
| commit | 96d7fe16eaf6b656800f08da3156bacd75ca3b08 (patch) | |
| tree | 98d884e096b5108d8181914540718b6b82c6893e /main.c | |
| parent | small fix (diff) | |
| download | dwm-96d7fe16eaf6b656800f08da3156bacd75ca3b08.tar.gz dwm-96d7fe16eaf6b656800f08da3156bacd75ca3b08.zip | |
prepared merging layout.c and tag.c into screen.c
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 28 |
1 files changed, 28 insertions, 0 deletions
| @@ -143,6 +143,7 @@ setup(void) { | |||
| 143 | dwmprops = XInternAtom(dpy, "_DWM_PROPERTIES", False); | 143 | dwmprops = XInternAtom(dpy, "_DWM_PROPERTIES", False); |
| 144 | wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False); | 144 | wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False); |
| 145 | wmatom[WMDelete] = XInternAtom(dpy, "WM_DELETE_WINDOW", False); | 145 | wmatom[WMDelete] = XInternAtom(dpy, "WM_DELETE_WINDOW", False); |
| 146 | wmatom[WMName] = XInternAtom(dpy, "WM_NAME", False); | ||
| 146 | wmatom[WMState] = XInternAtom(dpy, "WM_STATE", False); | 147 | wmatom[WMState] = XInternAtom(dpy, "WM_STATE", False); |
| 147 | netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False); | 148 | netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False); |
| 148 | netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False); | 149 | netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False); |
| @@ -220,6 +221,33 @@ xerrorstart(Display *dsply, XErrorEvent *ee) { | |||
| 220 | 221 | ||
| 221 | /* extern */ | 222 | /* extern */ |
| 222 | 223 | ||
| 224 | Bool | ||
| 225 | gettextprop(Window w, Atom atom, char *text, unsigned int size) { | ||
| 226 | char **list = NULL; | ||
| 227 | int n; | ||
| 228 | XTextProperty name; | ||
| 229 | |||
| 230 | if(!text || size == 0) | ||
| 231 | return False; | ||
| 232 | text[0] = '\0'; | ||
| 233 | XGetTextProperty(dpy, w, &name, atom); | ||
| 234 | if(!name.nitems) | ||
| 235 | return False; | ||
| 236 | if(name.encoding == XA_STRING) | ||
| 237 | strncpy(text, (char *)name.value, size - 1); | ||
| 238 | else { | ||
| 239 | if(XmbTextPropertyToTextList(dpy, &name, &list, &n) >= Success | ||
| 240 | && n > 0 && *list) | ||
| 241 | { | ||
| 242 | strncpy(text, *list, size - 1); | ||
| 243 | XFreeStringList(list); | ||
| 244 | } | ||
| 245 | } | ||
| 246 | text[size - 1] = '\0'; | ||
| 247 | XFree(name.value); | ||
| 248 | return True; | ||
| 249 | } | ||
| 250 | |||
| 223 | void | 251 | void |
| 224 | quit(const char *arg) { | 252 | quit(const char *arg) { |
| 225 | readin = running = False; | 253 | readin = running = False; |
