Move corner textures from ssd.c to theme.c

It makes more sense to just keep one set of corner textures for server
side view decorations, rather than storing a set for each view. This also
keeps the code simpler when when changing theme parameters.
This commit is contained in:
Johan Malm 2021-07-16 17:07:00 +01:00
parent c668fd9b07
commit e50bb45890
5 changed files with 182 additions and 140 deletions

View file

@ -478,16 +478,19 @@ render_deco(struct view *view, struct output *output,
struct wlr_seat *seat = view->server->seat.seat;
bool focused = view->surface == seat->keyboard_state.focused_surface;
/* render texture or rectangle */
struct ssd_part *part;
wl_list_for_each_reverse(part, &view->ssd.parts, link) {
if (part->texture.active) {
if (part->texture.active && *(part->texture.active)) {
struct wlr_texture *texture = focused ?
part->texture.active : part->texture.inactive;
*(part->texture.active) :
*(part->texture.inactive);
render_texture_helper(output, output_damage, &part->box,
texture);
} else {
float *color = focused ?
part->color.active : part->color.inactive;
part->color.active :
part->color.inactive;
render_rect(output, output_damage, &part->box, color);
}
}