diff options
Diffstat (limited to '')
| -rw-r--r-- | dwm.c | 23 |
1 files changed, 8 insertions, 15 deletions
| @@ -918,13 +918,11 @@ gettextprop(Window w, Atom atom, char *text, unsigned int size) | |||
| 918 | text[0] = '\0'; | 918 | text[0] = '\0'; |
| 919 | if (!XGetTextProperty(dpy, w, &name, atom) || !name.nitems) | 919 | if (!XGetTextProperty(dpy, w, &name, atom) || !name.nitems) |
| 920 | return 0; | 920 | return 0; |
| 921 | if (name.encoding == XA_STRING) | 921 | if (name.encoding == XA_STRING) { |
| 922 | strncpy(text, (char *)name.value, size - 1); | 922 | strncpy(text, (char *)name.value, size - 1); |
| 923 | else { | 923 | } else if (XmbTextPropertyToTextList(dpy, &name, &list, &n) >= Success && n > 0 && *list) { |
| 924 | if (XmbTextPropertyToTextList(dpy, &name, &list, &n) >= Success && n > 0 && *list) { | 924 | strncpy(text, *list, size - 1); |
| 925 | strncpy(text, *list, size - 1); | 925 | XFreeStringList(list); |
| 926 | XFreeStringList(list); | ||
| 927 | } | ||
| 928 | } | 926 | } |
| 929 | text[size - 1] = '\0'; | 927 | text[size - 1] = '\0'; |
| 930 | XFree(name.value); | 928 | XFree(name.value); |
| @@ -1099,9 +1097,7 @@ maprequest(XEvent *e) | |||
| 1099 | static XWindowAttributes wa; | 1097 | static XWindowAttributes wa; |
| 1100 | XMapRequestEvent *ev = &e->xmaprequest; | 1098 | XMapRequestEvent *ev = &e->xmaprequest; |
| 1101 | 1099 | ||
| 1102 | if (!XGetWindowAttributes(dpy, ev->window, &wa)) | 1100 | if (!XGetWindowAttributes(dpy, ev->window, &wa) || wa.override_redirect) |
| 1103 | return; | ||
| 1104 | if (wa.override_redirect) | ||
| 1105 | return; | 1101 | return; |
| 1106 | if (!wintoclient(ev->window)) | 1102 | if (!wintoclient(ev->window)) |
| 1107 | manage(ev->window, &wa); | 1103 | manage(ev->window, &wa); |
| @@ -1603,7 +1599,6 @@ setup(void) | |||
| 1603 | focus(NULL); | 1599 | focus(NULL); |
| 1604 | } | 1600 | } |
| 1605 | 1601 | ||
| 1606 | |||
| 1607 | void | 1602 | void |
| 1608 | seturgent(Client *c, int urg) | 1603 | seturgent(Client *c, int urg) |
| 1609 | { | 1604 | { |
| @@ -2124,12 +2119,10 @@ zoom(const Arg *arg) | |||
| 2124 | { | 2119 | { |
| 2125 | Client *c = selmon->sel; | 2120 | Client *c = selmon->sel; |
| 2126 | 2121 | ||
| 2127 | if (!selmon->lt[selmon->sellt]->arrange | 2122 | if (!selmon->lt[selmon->sellt]->arrange || !c || c->isfloating) |
| 2128 | || (selmon->sel && selmon->sel->isfloating)) | 2123 | return; |
| 2124 | if (c == nexttiled(selmon->clients) && !(c = nexttiled(c->next))) | ||
| 2129 | return; | 2125 | return; |
| 2130 | if (c == nexttiled(selmon->clients)) | ||
| 2131 | if (!c || !(c = nexttiled(c->next))) | ||
| 2132 | return; | ||
| 2133 | pop(c); | 2126 | pop(c); |
| 2134 | } | 2127 | } |
| 2135 | 2128 | ||
