171 XKillClient(dpy, sel->win); |
171 XKillClient(dpy, sel->win); |
172 } |
172 } |
173 |
173 |
174 void |
174 void |
175 manage(Window w, XWindowAttributes *wa) { |
175 manage(Window w, XWindowAttributes *wa) { |
176 Client *c, *t; |
176 Client *c, *t = NULL; |
177 Window trans; |
177 Window trans; |
|
178 Status rettrans; |
178 XWindowChanges wc; |
179 XWindowChanges wc; |
179 |
180 |
180 c = emallocz(sizeof(Client)); |
181 c = emallocz(sizeof(Client)); |
181 c->tags = emallocz(ntags * sizeof(Bool)); |
182 c->tags = emallocz(ntags * sizeof(Bool)); |
182 c->win = w; |
183 c->win = w; |
201 c->y = way; |
202 c->y = way; |
202 } |
203 } |
203 updatesizehints(c); |
204 updatesizehints(c); |
204 XSelectInput(dpy, w, |
205 XSelectInput(dpy, w, |
205 StructureNotifyMask | PropertyChangeMask | EnterWindowMask); |
206 StructureNotifyMask | PropertyChangeMask | EnterWindowMask); |
206 XGetTransientForHint(dpy, w, &trans); |
|
207 grabbuttons(c, False); |
207 grabbuttons(c, False); |
208 wc.border_width = c->border; |
208 wc.border_width = c->border; |
209 XConfigureWindow(dpy, w, CWBorderWidth, &wc); |
209 XConfigureWindow(dpy, w, CWBorderWidth, &wc); |
210 XSetWindowBorder(dpy, w, dc.norm[ColBorder]); |
210 XSetWindowBorder(dpy, w, dc.norm[ColBorder]); |
211 configure(c); /* propagates border_width, if size doesn't change */ |
211 configure(c); /* propagates border_width, if size doesn't change */ |
212 updatetitle(c); |
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 settags(c, t); |
215 settags(c, t); |
215 if(!c->isfloating) |
216 if(!c->isfloating) |
216 c->isfloating = (t != NULL) || c->isfixed; |
217 c->isfloating = (rettrans == Success) || c->isfixed; |
217 attach(c); |
218 attach(c); |
218 attachstack(c); |
219 attachstack(c); |
219 c->isbanned = True; |
220 c->isbanned = True; |
220 XMoveWindow(dpy, w, c->x + 2 * sw, c->y); |
221 XMoveWindow(dpy, w, c->x + 2 * sw, c->y); |
221 XMapWindow(dpy, w); |
222 XMapWindow(dpy, w); |