make also transients floating when we do not know the main window
540d5eed
1 file(s) · +5 −4
| 173 | 173 | ||
| 174 | 174 | void |
|
| 175 | 175 | manage(Window w, XWindowAttributes *wa) { |
|
| 176 | - | Client *c, *t; |
|
| 176 | + | Client *c, *t = NULL; |
|
| 177 | 177 | Window trans; |
|
| 178 | + | Status rettrans; |
|
| 178 | 179 | XWindowChanges wc; |
|
| 179 | 180 | ||
| 180 | 181 | c = emallocz(sizeof(Client)); |
|
| 203 | 204 | updatesizehints(c); |
|
| 204 | 205 | XSelectInput(dpy, w, |
|
| 205 | 206 | StructureNotifyMask | PropertyChangeMask | EnterWindowMask); |
|
| 206 | - | XGetTransientForHint(dpy, w, &trans); |
|
| 207 | 207 | grabbuttons(c, False); |
|
| 208 | 208 | wc.border_width = c->border; |
|
| 209 | 209 | XConfigureWindow(dpy, w, CWBorderWidth, &wc); |
|
| 210 | 210 | XSetWindowBorder(dpy, w, dc.norm[ColBorder]); |
|
| 211 | 211 | configure(c); /* propagates border_width, if size doesn't change */ |
|
| 212 | 212 | updatetitle(c); |
|
| 213 | - | for(t = clients; t && t->win != trans; t = t->next); |
|
| 213 | + | if((rettrans = XGetTransientForHint(dpy, w, &trans) == Success)) |
|
| 214 | + | for(t = clients; t && t->win != trans; t = t->next); |
|
| 214 | 215 | settags(c, t); |
|
| 215 | 216 | if(!c->isfloating) |
|
| 216 | - | c->isfloating = (t != NULL) || c->isfixed; |
|
| 217 | + | c->isfloating = (rettrans == Success) || c->isfixed; |
|
| 217 | 218 | attach(c); |
|
| 218 | 219 | attachstack(c); |
|
| 219 | 220 | c->isbanned = True; |
|