client.c
changeset 946 b938876de936
parent 945 89ea2acd2646
child 952 4f66942cc63b
equal deleted inserted replaced
945:89ea2acd2646 946:b938876de936
   228 	attachstack(c);
   228 	attachstack(c);
   229 	XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h); /* some windows require this */
   229 	XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h); /* some windows require this */
   230 	setclientstate(c, IconicState);
   230 	setclientstate(c, IconicState);
   231 	c->isbanned = True;
   231 	c->isbanned = True;
   232 	focus(c);
   232 	focus(c);
   233 	lt->arrange();
   233 	arrange();
   234 }
   234 }
   235 
   235 
   236 void
   236 void
   237 resize(Client *c, int x, int y, int w, int h, Bool sizehints) {
   237 resize(Client *c, int x, int y, int w, int h, Bool sizehints) {
   238 	double dx, dy, max, min, ratio;
   238 	double dx, dy, max, min, ratio;
   239 	XWindowChanges wc; 
   239 	XWindowChanges wc; 
       
   240 
   240 	if(sizehints) {
   241 	if(sizehints) {
   241 		if(c->minay > 0 && c->maxay > 0 && (h - c->baseh) > 0 && (w - c->basew) > 0) {
   242 		if(c->minay > 0 && c->maxay > 0 && (h - c->baseh) > 0 && (w - c->basew) > 0) {
   242 			dx = (double)(w - c->basew);
   243 			dx = (double)(w - c->basew);
   243 			dy = (double)(h - c->baseh);
   244 			dy = (double)(h - c->baseh);
   244 			min = (double)(c->minax) / (double)(c->minay);
   245 			min = (double)(c->minax) / (double)(c->minay);
   295 	}
   296 	}
   296 }
   297 }
   297 
   298 
   298 void
   299 void
   299 togglefloating(const char *arg) {
   300 togglefloating(const char *arg) {
   300 	if(!sel || lt->arrange == floating)
   301 	if(!sel || isfloating())
   301 		return;
   302 		return;
   302 	sel->isfloating = !sel->isfloating;
   303 	sel->isfloating = !sel->isfloating;
   303 	if(sel->isfloating)
   304 	if(sel->isfloating)
   304 		resize(sel, sel->x, sel->y, sel->w, sel->h, True);
   305 		resize(sel, sel->x, sel->y, sel->w, sel->h, True);
   305 	lt->arrange();
   306 	arrange();
   306 }
   307 }
   307 
   308 
   308 void
   309 void
   309 unban(Client *c) {
   310 unban(Client *c) {
   310 	if(!c->isbanned)
   311 	if(!c->isbanned)
   332 	free(c->tags);
   333 	free(c->tags);
   333 	free(c);
   334 	free(c);
   334 	XSync(dpy, False);
   335 	XSync(dpy, False);
   335 	XSetErrorHandler(xerror);
   336 	XSetErrorHandler(xerror);
   336 	XUngrabServer(dpy);
   337 	XUngrabServer(dpy);
   337 	lt->arrange();
   338 	arrange();
   338 }
   339 }
   339 
   340 
   340 void
   341 void
   341 updatesizehints(Client *c) {
   342 updatesizehints(Client *c) {
   342 	long msize;
   343 	long msize;