comparison client.c @ 314:8bafc3ac9f58

made a new client position strategy similiar to that one proposed by Sander, but which takes top bar into account
author Anselm R.Garbe <arg@10ksloc.org>
date Fri, 18 Aug 2006 08:39:33 +0200
parents 8b109976c594
children d9bef4067cd5
comparison
equal deleted inserted replaced
313:8b109976c594 314:8bafc3ac9f58
201 c->th = bh; 201 c->th = bh;
202 202
203 c->border = 0; 203 c->border = 0;
204 setsize(c); 204 setsize(c);
205 205
206 if(c->x + c->w > sw)
207 c->x = sw - c->w - 2;
208 if(c->x < 0)
209 c->x = 0;
210 if(c->y + c->h > sh)
211 c->y = sh - c->h - 2;
206 if(c->h != sh && c->y < bh) 212 if(c->h != sh && c->y < bh)
207 c->y = c->ty = bh; 213 c->y = bh;
208 214
209 c->proto = getproto(c->win); 215 c->proto = getproto(c->win);
210 XSelectInput(dpy, c->win, 216 XSelectInput(dpy, c->win,
211 StructureNotifyMask | PropertyChangeMask | EnterWindowMask); 217 StructureNotifyMask | PropertyChangeMask | EnterWindowMask);
212 XGetTransientForHint(dpy, c->win, &trans); 218 XGetTransientForHint(dpy, c->win, &trans);
255 if(!c->isfloat) 261 if(!c->isfloat)
256 c->isfloat = trans 262 c->isfloat = trans
257 || (c->maxw && c->minw && 263 || (c->maxw && c->minw &&
258 c->maxw == c->minw && c->maxh == c->minh); 264 c->maxw == c->minw && c->maxh == c->minh);
259 settitle(c); 265 settitle(c);
260
261 if(!trans) {
262 c->x = (sw / 2) - (c->w / 2);
263 c->y = ((sh - bh) / 2) - (c->h / 2) + bh;
264 }
265
266 if(isvisible(c)) 266 if(isvisible(c))
267 sel = c; 267 sel = c;
268 arrange(NULL); 268 arrange(NULL);
269 XMapWindow(dpy, c->win); 269 XMapWindow(dpy, c->win);
270 XMapWindow(dpy, c->title); 270 XMapWindow(dpy, c->title);