when scrolling, all the items need to be redrawn to make parentrelative work

This commit is contained in:
Dana Jansens 2008-02-05 00:11:38 -05:00
parent b097f84dfd
commit 0369732c35

View file

@ -513,53 +513,43 @@ static void popup_render(ObFocusCyclePopup *p, const ObClient *c)
XMapWindow(obt_display, target->iconwin); XMapWindow(obt_display, target->iconwin);
} }
/* only draw if we have to */ /* get the icon from the client */
if (!p->mapped || icon = client_icon(target->client, ICON_SIZE, ICON_SIZE);
newtarget == target || p->last_target == target || p->a_icon->texture[0].data.rgba.width = icon->width;
/* wasn't visible before... */ p->a_icon->texture[0].data.rgba.height = icon->height;
((row + p->scroll < last_scroll || p->a_icon->texture[0].data.rgba.twidth = ICON_SIZE;
row + p->scroll >= last_scroll + icon_rows) && p->a_icon->texture[0].data.rgba.theight = ICON_SIZE;
/* ...and is visible now */ p->a_icon->texture[0].data.rgba.tx = HILITE_OFFSET;
(row >= 0 && row < icon_rows))) p->a_icon->texture[0].data.rgba.ty = HILITE_OFFSET;
p->a_icon->texture[0].data.rgba.alpha =
target->client->iconic ? OB_ICONIC_ALPHA : 0xff;
p->a_icon->texture[0].data.rgba.data = icon->data;
/* Draw the hilite? */
p->a_icon->texture[1].type = (target == newtarget) ?
RR_TEXTURE_RGBA : RR_TEXTURE_NONE;
/* draw the icon */
p->a_icon->surface.parentx = iconx;
p->a_icon->surface.parenty = icony;
RrPaint(p->a_icon, target->iconwin, HILITE_SIZE, HILITE_SIZE);
/* draw the text */
if (p->mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST ||
target == newtarget)
{ {
/* get the icon from the client */ text = (target == newtarget) ? p->a_hilite_text : p->a_text;
icon = client_icon(target->client, ICON_SIZE, ICON_SIZE); text->texture[0].data.text.string = target->text;
p->a_icon->texture[0].data.rgba.width = icon->width; text->surface.parentx =
p->a_icon->texture[0].data.rgba.height = icon->height; p->mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS ?
p->a_icon->texture[0].data.rgba.twidth = ICON_SIZE; icon_mode_textx : list_mode_textx;
p->a_icon->texture[0].data.rgba.theight = ICON_SIZE; text->surface.parenty =
p->a_icon->texture[0].data.rgba.tx = HILITE_OFFSET; p->mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS ?
p->a_icon->texture[0].data.rgba.ty = HILITE_OFFSET; icon_mode_texty : list_mode_texty;
p->a_icon->texture[0].data.rgba.alpha = RrPaint(text,
target->client->iconic ? OB_ICONIC_ALPHA : 0xff; (p->mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS ?
p->a_icon->texture[0].data.rgba.data = icon->data; p->icon_mode_text : target->textwin),
textw, texth);
/* Draw the hilite? */
p->a_icon->texture[1].type = (target == newtarget) ?
RR_TEXTURE_RGBA : RR_TEXTURE_NONE;
/* draw the icon */
p->a_icon->surface.parentx = iconx;
p->a_icon->surface.parenty = icony;
RrPaint(p->a_icon, target->iconwin, HILITE_SIZE, HILITE_SIZE);
/* draw the text */
if (p->mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST ||
target == newtarget)
{
text = (target == newtarget) ? p->a_hilite_text : p->a_text;
text->texture[0].data.text.string = target->text;
text->surface.parentx =
p->mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS ?
icon_mode_textx : list_mode_textx;
text->surface.parenty =
p->mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS ?
icon_mode_texty : list_mode_texty;
RrPaint(text,
(p->mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS ?
p->icon_mode_text : target->textwin),
textw, texth);
}
} }
} }
} }