From d28008aa639d1f971ee5874a6e20ddf2c9c8bfa9 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sun, 1 May 2011 18:48:30 +0200 Subject: [PATCH] =?utf8?q?Bugfix:=20Correctly=20render=20decorations=20in?= =?utf8?q?=20tabbed=20containers=20(don=E2=80=99t=20overlap)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This fixes a regression introduced in b644fb5f26c1768b70c5b49d8cd917a63a2d1d91. --- include/x.h | 2 +- src/floating.c | 2 +- src/x.c | 26 +++++++++++++++++++++----- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/include/x.h b/include/x.h index 827f6f85..d110d92c 100644 --- a/include/x.h +++ b/include/x.h @@ -66,7 +66,7 @@ void x_draw_decoration(Con *con); * It recursively traverses all children of the given node. * */ -void x_push_node(Con *con, bool skip_decoration); +void x_push_node(Con *con); /** * Pushes all changes (state of each node, see x_push_node() and the window diff --git a/src/floating.c b/src/floating.c index 1d08ec9e..23f8a60a 100644 --- a/src/floating.c +++ b/src/floating.c @@ -277,7 +277,7 @@ DRAGGING_CB(drag_window_callback) { con->rect.y = old_rect->y + (new_y - event->root_y); render_con(con, false); - x_push_node(con, true); + x_push_node(con); xcb_flush(conn); /* Check if we cross workspace boundaries while moving */ diff --git a/src/x.c b/src/x.c index ab60c51d..2e77b143 100644 --- a/src/x.c +++ b/src/x.c @@ -442,7 +442,7 @@ update_pixmaps: * It recursively traverses all children of the given node. * */ -void x_push_node(Con *con, bool skip_decoration) { +void x_push_node(Con *con) { Con *current; con_state *state; Rect rect = con->rect; @@ -584,10 +584,25 @@ void x_push_node(Con *con, bool skip_decoration) { * in focus order to display the focused client in a stack first when * switching workspaces (reduces flickering). */ TAILQ_FOREACH(current, &(con->focus_head), focused) - x_push_node(current, skip_decoration); + x_push_node(current); +} + +/* + * Recursively calls x_draw_decoration. This cannot be done in x_push_node + * because x_push_node uses focus order to recurse (see the comment above) + * while drawing the decoration needs to happen in the actual order. + * + */ +static void x_deco_recurse(Con *con) { + Con *current; + + TAILQ_FOREACH(current, &(con->nodes_head), nodes) + x_deco_recurse(current); + + TAILQ_FOREACH(current, &(con->floating_head), floating_windows) + x_deco_recurse(current); - if (!skip_decoration && - (con->type != CT_ROOT && con->type != CT_OUTPUT) && + if ((con->type != CT_ROOT && con->type != CT_OUTPUT) && con->mapped) x_draw_decoration(con); } @@ -691,7 +706,8 @@ void x_push_changes(Con *con) { DLOG("Done, EnterNotify re-enabled\n"); DLOG("\n\n PUSHING CHANGES\n\n"); - x_push_node(con, false); + x_push_node(con); + x_deco_recurse(con); xcb_window_t to_focus = focused->frame; if (focused->window != NULL) -- 2.39.5