Skip to content

Commit

Permalink
More precise cut and also react on _NET_WM_WORKAREA changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
nsf committed Jan 17, 2010
1 parent 621c349 commit 5fda82e
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions widget-pager.c
Expand Up @@ -368,6 +368,8 @@ static void draw(struct widget *w)
activeps = ps;
}

r.x++; r.y++; r.w -= 2; r.h -= 2;

size_t visible_tasks_count = 0;
size_t j;
for (j = 0; j < pw->windows_n; ++j) {
Expand All @@ -380,8 +382,8 @@ static void draw(struct widget *w)
unsigned char *window_border;
struct rect intersection;
struct rect winr;
winr.x = r.x + 1 + (t->x - pd->workarea.x) / pd->div;
winr.y = r.y + 1 + (t->y - pd->workarea.y) / pd->div;
winr.x = r.x + (t->x - pd->workarea.x) / pd->div;
winr.y = r.y + (t->y - pd->workarea.y) / pd->div;
winr.w = t->w / pd->div;
winr.h = t->h / pd->div;
if (!rect_intersection(&intersection, &winr, &r))
Expand All @@ -399,6 +401,8 @@ static void draw(struct widget *w)
}
}

r.x--; r.y--; r.w += 2; r.h += 2;

draw_rectangle_outline(cr, ps->border, &r);
if (ps->font.pfd && visible_tasks_count) {
/* draw number */
Expand Down Expand Up @@ -432,14 +436,19 @@ static void prop_change(struct widget *w, XPropertyEvent *e)
struct x_connection *c = &w->panel->connection;

if (e->window == c->root) {
if (e->atom == c->atoms[XATOM_NET_NUMBER_OF_DESKTOPS])
{
if (e->atom == c->atoms[XATOM_NET_NUMBER_OF_DESKTOPS]) {
update_desktops(pw, c);
resize_desktops(w);
recalculate_widgets_sizes(w->panel);
return;
}

if (e->atom == c->atoms[XATOM_NET_WORKAREA]) {
resize_desktops(w);
recalculate_widgets_sizes(w->panel);
return;
}

if (e->atom == c->atoms[XATOM_NET_ACTIVE_WINDOW]) {
update_active(pw, c);
w->needs_expose = 1;
Expand Down

0 comments on commit 5fda82e

Please sign in to comment.