x: Don’t pre-render the decoration for windows inside a stack which are not visible

Saves n-1 decoration renderings for n windows in a stack whenever a new window
gets added or removed.
This commit is contained in:
Michael Stapelberg 2011-07-10 21:54:34 +02:00
parent d7f9700ba4
commit 7d9ba707b3
1 changed files with 9 additions and 4 deletions

13
src/x.c
View File

@ -578,10 +578,15 @@ void x_push_node(Con *con) {
con->pixmap_recreated = true; con->pixmap_recreated = true;
/* Render the decoration now to make the correct decoration visible /* Dont render the decoration for windows inside a stack which are
* from the very first moment. Later calls will be cached, so this * not visible right now */
* doesnt hurt performance. */ if (!con->parent ||
x_deco_recurse(con); con->parent->layout != L_STACKED ||
TAILQ_FIRST(&(con->parent->focus_head)) == con)
/* Render the decoration now to make the correct decoration visible
* from the very first moment. Later calls will be cached, so this
* doesnt hurt performance. */
x_deco_recurse(con);
} }
DLOG("setting rect (%d, %d, %d, %d)\n", rect.x, rect.y, rect.width, rect.height); DLOG("setting rect (%d, %d, %d, %d)\n", rect.x, rect.y, rect.width, rect.height);