fix a redraw issue (on mousefocus of a client in an area, that area's prevsel client's has to be redrawn too)

This commit is contained in:
Sander van Dijk 2006-05-08 19:44:56 +00:00
parent e02d9ae205
commit 7b8e9aa512
4 changed files with 14 additions and 1 deletions

View File

@ -307,3 +307,12 @@ is_of_area(Area *a, Client *c)
return True;
return False;
}
Client *
sel_client_of_area(Area *a)
{
if(a) {
return (a->frame.size) ? a->frame.data[a->sel]->client : nil;
}
return nil;
}

View File

@ -120,6 +120,7 @@ focus_client(Client *c, Bool restack)
{
Client *old = sel_client();
Frame *f = c->frame.data[c->sel];
Client *old_in_area = sel_client_of_area(f->area);
View *v = f->area->view;
int i = idx_of_area(f->area);
static char buf[256];
@ -139,6 +140,8 @@ focus_client(Client *c, Bool restack)
XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
if(old)
draw_client(old);
if(old_in_area != c)
draw_client(old_in_area);
draw_client(c);
XSync(dpy, False);
snprintf(buf, sizeof(buf), "ClientFocus %d\n", idx_of_client_id(c->id));

View File

@ -232,7 +232,7 @@ sel_client_of_view(View *v)
{
if(v) {
Area *a = v->area.size ? v->area.data[v->sel] : nil;
return (a && a->frame.size) ? a->frame.data[a->sel]->client : nil;
return sel_client_of_area(a);
}
return nil;
}

View File

@ -198,6 +198,7 @@ void send_to_area(Area *to, Area *from, Client *c);
void attach_to_area(Area *a, Client *c);
void detach_from_area(Area *a, Client *c);
Bool is_of_area(Area *a, Client *c);
Client *sel_client_of_area(Area *a);
/* bar.c */
Bar *create_bar(char *name, Bool intern);