x: Set pixmap as background window, saves a lot of CopyAreas
This commit is contained in:
parent
3d5af35fa4
commit
84b804cda6
16
src/x.c
16
src/x.c
|
@ -277,9 +277,9 @@ void x_draw_decoration(Con *con) {
|
|||
(con->window == NULL || !con->window->name_x_changed) &&
|
||||
!con->parent->pixmap_recreated &&
|
||||
memcmp(p, con->deco_render_params, sizeof(struct deco_render_params)) == 0) {
|
||||
DLOG("CACHE HIT, copying existing pixmaps\n");
|
||||
DLOG("CACHE HIT, not re-rendering\n");
|
||||
free(p);
|
||||
goto copy_pixmaps;
|
||||
return;
|
||||
}
|
||||
|
||||
DLOG("CACHE MISS\n");
|
||||
|
@ -350,7 +350,7 @@ void x_draw_decoration(Con *con) {
|
|||
* decoration. */
|
||||
if (p->border_style != BS_NORMAL) {
|
||||
DLOG("border style not BS_NORMAL, aborting rendering of decoration\n");
|
||||
goto copy_pixmaps;
|
||||
goto update_pixmaps;
|
||||
}
|
||||
|
||||
/* 4: paint the bar */
|
||||
|
@ -390,7 +390,7 @@ void x_draw_decoration(Con *con) {
|
|||
"another container"
|
||||
);
|
||||
|
||||
goto copy_pixmaps;
|
||||
goto update_pixmaps;
|
||||
}
|
||||
|
||||
int indent_level = 0,
|
||||
|
@ -431,9 +431,9 @@ void x_draw_decoration(Con *con) {
|
|||
win->name_x
|
||||
);
|
||||
|
||||
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, parent->pixmap, parent->frame, parent->pm_gc, 0, 0, 0, 0, parent->rect.width, parent->rect.height);
|
||||
update_pixmaps:
|
||||
xcb_clear_area(conn, false, con->frame, 0, 0, con->rect.width, con->rect.height);
|
||||
xcb_clear_area(conn, false, parent->frame, 0, 0, parent->rect.width, parent->rect.height);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -526,6 +526,8 @@ void x_push_node(Con *con, bool skip_decoration) {
|
|||
}
|
||||
xcb_create_pixmap(conn, root_depth, con->pixmap, con->frame, rect.width, rect.height);
|
||||
xcb_create_gc(conn, con->pm_gc, con->pixmap, 0, 0);
|
||||
uint32_t values[] = { con->pixmap };
|
||||
xcb_change_window_attributes(conn, con->frame, XCB_CW_BACK_PIXMAP, values);
|
||||
con->pixmap_recreated = true;
|
||||
}
|
||||
memcpy(&(state->rect), &rect, sizeof(Rect));
|
||||
|
|
Loading…
Reference in New Issue