Fix column drawing on mode switch and in stacking mode (forgot to commit yesterday)

This commit is contained in:
Kris Maglione 2006-06-26 15:45:59 -04:00
parent edae9ff3ee
commit c422de344e
5 changed files with 34 additions and 34 deletions

View File

@ -33,7 +33,8 @@ Area *
area_of_id(View *v, unsigned short id)
{
Area *a;
for(a=v->area; a && a->id != id; a=a->next);
for(a=v->area; a; a=a->next)
if(a->id == id) break;
return a;
}
@ -87,12 +88,10 @@ void
destroy_area(Area *a)
{
Client *c;
Area *t;
Area *ta;
View *v = a->view;
if(a->frame) {
fprintf(stderr, "%s", "wmiiwm: fatal, destroying non-empty area\n");
exit(1);
}
cext_assert(!a->frame && "wmiiwm: fatal, destroying non-empty area");
if(v->revert == a)
v->revert = nil;
@ -101,11 +100,11 @@ destroy_area(Area *a)
if(c->revert == a)
c->revert = nil;
for(t=v->area; t && t->next != a; t=t->next);
if(t) {
t->next = a->next;
for(ta=v->area; ta && ta->next != a; ta=ta->next);
if(ta) {
ta->next = a->next;
if(v->sel == a)
v->sel = t == v->area ? t->next : t;
v->sel = ta->floating ? ta->next : ta;
}
free(a);
}
@ -346,7 +345,10 @@ select_area(Area *a, char *arg)
return Ebadvalue;
for(p=a->frame; p->anext; p=p->anext)
if(p->anext == f) break;
focus_client(p->client, True);
a->sel = p;
arrange_column(a, False);
if(v == sel)
focus_view(v);
flush_masked_events(EnterWindowMask);
return nil;
}
@ -354,7 +356,10 @@ select_area(Area *a, char *arg)
if(!f)
return Ebadvalue;
p = f->anext ? f->anext : a->frame;
focus_client(p->client, True);
a->sel = p;
arrange_column(a, False);
if(v == sel)
focus_view(v);
flush_masked_events(EnterWindowMask);
return nil;
}
@ -366,7 +371,7 @@ select_area(Area *a, char *arg)
if(new->sel)
focus_client(new->sel->client, True);
v->sel = new;
if(!a->floating)
if(a->floating != new->floating)
v->revert = a;
draw_frames();
return nil;

View File

@ -486,7 +486,7 @@ resize_client(Client *c, XRectangle *r, Bool ignore_xcall)
Frame *f = c->sel;
Bool floating = f->area->floating;
BlitzAlign stickycorner = 0;;
BlitzAlign stickycorner = 0;
if(f->rect.x != r->x && f->rect.x + f->rect.width == r->x + r->width)
stickycorner |= EAST;
else
@ -709,8 +709,8 @@ client_of_win(Window w)
}
static int
compare_tags(const void **a, const void **b) {
return strcmp(*a, *b);
compare_tags(const void *a, const void *b) {
return strcmp(*(char **)a, *(char **)b);
}
void
@ -765,15 +765,15 @@ apply_tags(Client *c, const char *tags)
}
c->tags[0] = '\0';
qsort(toks, j, sizeof(char *), (void *)compare_tags);
for(i=0, n=0; i < j; i++) {
qsort(toks, j, sizeof(char *), compare_tags);
for(i=0, n=0; i < j; i++)
if(!n || strcmp(toks[i], toks[n-1])) {
if(n)
cext_strlcat(c->tags, "+", sizeof(c->tags) - strlen(c->tags) - 1);
cext_strlcat(c->tags, toks[i], sizeof(c->tags) - strlen(c->tags) - 1);
toks[n++] = toks[i];
}
}
toks[i] = nil;
update_client_views(c, toks);

View File

@ -28,25 +28,18 @@ view_of_id(unsigned short id) {
}
View *
view_of_name(const char *name)
get_view(const char *name)
{
View *v;
int cmp;
for(v = view; v; v=v->next)
if(!(cmp=strcmp(name, v->name)))
if((cmp=strcmp(name, v->name)) >= 0)
break;
else if(cmp > 0)
return nil;
if(!v || cmp != 0)
v = create_view(name);
return v;
}
View *
get_view(const char *name)
{
View *v = view_of_name(name);
return v ? v : create_view(name);
}
static void
assign_sel_view(View *v)
{
@ -393,6 +386,8 @@ message_view(View *v, char *message) {
a->mode = i;
arrange_column(a, True);
restack_view(v);
if(v == sel)
focus_view(v);
draw_frames();
return nil;
}

View File

@ -45,12 +45,12 @@ ixp_client_dial(IXPClient *c, char *sockfile, unsigned int rootfid)
c->fcall.msize = IXP_MAX_MSG;
c->fcall.version = strdup(IXP_VERSION);
if(ixp_client_do_fcall(c) == -1) {
fprintf(stderr, "error: %s\n", c->fcall.ename);
fprintf(stderr, "error: %s\n", c->errstr);
ixp_client_hangup(c);
return -1;
}
if(strncmp(c->fcall.version, IXP_VERSION, strlen(IXP_VERSION))) {
fprintf(stderr, "error: %s\n", c->fcall.ename);
fprintf(stderr, "error: %s\n", c->errstr);
c->errstr = "9P versions differ";
ixp_client_hangup(c);
return -1; /* we cannot handle this version */
@ -64,7 +64,7 @@ ixp_client_dial(IXPClient *c, char *sockfile, unsigned int rootfid)
c->fcall.uname = strdup(getenv("USER"));
c->fcall.aname = strdup("");
if(ixp_client_do_fcall(c) == -1) {
fprintf(stderr, "error: %s\n", c->fcall.ename);
fprintf(stderr, "error: %s\n", c->errstr);
ixp_client_hangup(c);
return -1;
}

View File

@ -118,7 +118,7 @@ do
wmiir remove /lbar/$bar
done
seltag=`wmiir read /tag/sel/ctl`
seltag=`wmiir read /tag/sel/ctl 2>/dev/null`
for tag in `wmiir ls /tag | sed -e 's,/$,,; /^sel$/d'`
do
if [ "X$tag" = "X$seltag" ]; then