Fixed resizing first column, possible null pointer exception, and some whitespace changes.

This commit is contained in:
Kris Maglione 2006-06-09 19:57:00 -04:00
parent dd58d76cce
commit d293339496
5 changed files with 16 additions and 14 deletions

View File

@ -264,8 +264,8 @@ detach_from_area(Area *a, Client *c)
Frame *f;
for(f=c->frame; f && f->area != a; f=f->cnext);
if(f)
destroy_frame(f);
cext_assert(f->area == a);
destroy_frame(f);
if(a != a->view->area) {
if(a->frame)

View File

@ -443,7 +443,7 @@ void
destroy_client(Client *c)
{
View *v;
Client *tc;
Client **tc;
XGrabServer(dpy);
XSetErrorHandler(dummy_error_handler);
@ -461,13 +461,11 @@ destroy_client(Client *c)
reparent_client(c, root, c->rect.x, c->rect.y);
XFreeGC(dpy, c->gc);
XDestroyWindow(dpy, c->framewin);
if(c==client)
client = c->next;
else {
for(tc=client; tc && tc->next != c; tc=tc->next);
if(tc)
tc->next = c->next;
}
for(tc=&client; *tc && *tc != c; tc=&(*tc)->next);
cext_assert(*tc == c);
*tc = c->next;
update_views();
free(c);
@ -555,6 +553,7 @@ resize_client(Client *c, XRectangle *r, Bool ignore_xcall)
{
Frame *f = c->sel;
Bool floating = (f->area == f->area->view->area);
BlitzAlign stickycorner = 0;;
if(f->rect.x != r->x && f->rect.x + f->rect.width == r->x + r->width)
stickycorner |= EAST;
@ -564,6 +563,7 @@ resize_client(Client *c, XRectangle *r, Bool ignore_xcall)
stickycorner |= SOUTH;
else
stickycorner |= NORTH;
f->rect = *r;
if((f->area->mode != Colstack) || (f->area->sel == f))

View File

@ -227,10 +227,10 @@ drop_resize(Frame *f, XRectangle *new)
for(west=v->area->next; west && west->next != a; west=west->next);
/* first managed area is indexed 1, thus (i > 1) ? ... */
east = (west && west->next && west->next->next) ? west->next->next : nil;
east = a->next;
for(north=a->frame; north && north->anext != f; north=north->anext);
south = (north && north->anext && north->anext->anext) ? north->anext->anext : nil;
south = f->anext;
/* validate (and trim if necessary) horizontal resize */
if(new->width < MIN_COLWIDTH) {

View File

@ -37,6 +37,7 @@ remove_frame(Frame *f)
{
Area *a = f->area;
Frame **ft = &a->frame;
for(; *ft && *ft != f; ft=&(*ft)->anext);
cext_assert(*ft == f);
*ft = f->anext;

View File

@ -178,9 +178,10 @@ is_of_view(View *v, Client *c)
void
detach_from_view(View *v, Client *c)
{
Area *a;
Area *a, *next;
for(a=v->area; a; a=a->next) {
for(a=v->area; a; a=next) {
next=a->next;
if(is_of_area(a, c)) {
detach_from_area(a, c);
XMoveWindow(dpy, c->framewin, 2 * rect.width, 0);