improved draw_client stuff (if area 0 is selected and empty, prev area should not indicate any highlight)

This commit is contained in:
Anselm R. Garbe 2006-03-11 20:58:08 +01:00
parent 348311cfe0
commit 22387a5392
2 changed files with 17 additions and 11 deletions

View File

@ -106,10 +106,12 @@ select_area(Area *a, char *arg)
return;
}
new = t->area[i];
t->sel = i;
if(new->nframe)
focus_client(new->frame[new->sel]->client);
t->sel = i;
fprintf(stderr, "select_area: t->sel == %d\n", t->sel);
else
for(i = 0; i < a->nframe; i++)
draw_client(a->frame[i]->client);
}
void

View File

@ -1161,6 +1161,16 @@ xstat(IXPConn *c, Fcall *fcall)
return nil;
}
static void
draw_clients()
{
unsigned int i, j;
for(i = 0; i < nclient; i++)
for(j = 0; j < client[i]->nframe; j++)
if(client[i]->frame[j]->area->tag == tag[sel])
draw_client(client[i]);
}
static char *
xwrite(IXPConn *c, Fcall *fcall)
{
@ -1168,7 +1178,7 @@ xwrite(IXPConn *c, Fcall *fcall)
IXPMap *m = ixp_server_fid2map(c, fcall->fid);
unsigned char type;
unsigned int len;
int i, j, i1 = 0, i2 = 0, i3 = 0;
int i, i1 = 0, i2 = 0, i3 = 0;
Frame *f;
if(!m)
@ -1304,10 +1314,7 @@ xwrite(IXPConn *c, Fcall *fcall)
memcpy(def.selcolor, fcall->data, fcall->count);
def.selcolor[fcall->count] = 0;
blitz_loadcolor(dpy, screen, def.selcolor, &def.sel);
for(i = 0; i < nclient; i++)
for(j = 0; j < client[i]->nframe; j++)
if(client[i]->frame[j]->area->tag == tag[sel])
draw_client(client[i]);
draw_clients();
break;
case FsFnormcolors:
if((fcall->count != 23)
@ -1318,10 +1325,7 @@ xwrite(IXPConn *c, Fcall *fcall)
memcpy(def.normcolor, fcall->data, fcall->count);
def.normcolor[fcall->count] = 0;
blitz_loadcolor(dpy, screen, def.normcolor, &def.norm);
for(i = 0; i < nclient; i++)
for(j = 0; j < client[i]->nframe; j++)
if(client[i]->frame[j]->area->tag == tag[sel])
draw_client(client[i]);
draw_clients();
break;
case FsFkeys:
if(def.keyssz < fcall->offset + fcall->count + 1) {