x: when rendering stacked/tabbed cons, only update decoration once, saves some CopyAreas

This commit is contained in:
Michael Stapelberg 2011-07-10 20:01:29 +02:00
parent 8be26c9a22
commit 0d8dd571f8
1 changed files with 12 additions and 5 deletions

17
src/x.c
View File

@ -452,7 +452,6 @@ void x_draw_decoration(Con *con) {
copy_pixmaps: copy_pixmaps:
xcb_copy_area(conn, con->pixmap, con->frame, con->pm_gc, 0, 0, 0, 0, con->rect.width, con->rect.height); xcb_copy_area(conn, con->pixmap, con->frame, con->pm_gc, 0, 0, 0, 0, con->rect.width, con->rect.height);
xcb_copy_area(conn, parent->pixmap, parent->frame, parent->pm_gc, 0, 0, 0, 0, parent->rect.width, parent->rect.height);
} }
/* /*
@ -463,12 +462,20 @@ copy_pixmaps:
*/ */
static void x_deco_recurse(Con *con) { static void x_deco_recurse(Con *con) {
Con *current; Con *current;
bool leaf = TAILQ_EMPTY(&(con->nodes_head)) &&
TAILQ_EMPTY(&(con->floating_head));
con_state *state = state_for_frame(con->frame);
TAILQ_FOREACH(current, &(con->nodes_head), nodes) if (!leaf) {
x_deco_recurse(current); TAILQ_FOREACH(current, &(con->nodes_head), nodes)
x_deco_recurse(current);
TAILQ_FOREACH(current, &(con->floating_head), floating_windows) TAILQ_FOREACH(current, &(con->floating_head), floating_windows)
x_deco_recurse(current); x_deco_recurse(current);
if (state->mapped)
xcb_copy_area(conn, con->pixmap, con->frame, con->pm_gc, 0, 0, 0, 0, con->rect.width, con->rect.height);
}
if ((con->type != CT_ROOT && con->type != CT_OUTPUT) && if ((con->type != CT_ROOT && con->type != CT_OUTPUT) &&
con->mapped) con->mapped)