X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fx.c;h=ba157e2b56a494c367633bd73a023d775a3744f5;hb=e7a4580c5f5f895df2990dae0f26a8662d58d80f;hp=cd85bcc6be7546fbfbf0a270a42fd21c2d3c80ce;hpb=57effd65b29c5e4215b0408f416df0f5683a8ea4;p=i3%2Fi3 diff --git a/src/x.c b/src/x.c index cd85bcc6..ba157e2b 100644 --- a/src/x.c +++ b/src/x.c @@ -1,3 +1,5 @@ +#undef I3__FILE__ +#define I3__FILE__ "x.c" /* * vim:ts=4:sw=4:expandtab * @@ -305,13 +307,14 @@ void x_draw_decoration(Con *con) { * • non-leaf containers which are in a stacked/tabbed container * * It does not need to run for: - * • direct children of outputs + * • direct children of outputs or dockareas * • floating containers (they don’t have a decoration) */ if ((!leaf && parent->layout != L_STACKED && parent->layout != L_TABBED) || parent->type == CT_OUTPUT || + parent->type == CT_DOCKAREA || con->type == CT_FLOATING_CON) return; @@ -347,6 +350,7 @@ void x_draw_decoration(Con *con) { p->con_deco_rect = con->deco_rect; p->background = config.client.background; p->con_is_leaf = con_is_leaf(con); + p->parent_orientation = con_orientation(parent); if (con->deco_render_params != NULL && (con->window == NULL || !con->window->name_x_changed) && @@ -441,9 +445,9 @@ void x_draw_decoration(Con *con) { TAILQ_PREV(con, nodes_head, nodes) == NULL && con->parent->type != CT_FLOATING_CON) { xcb_change_gc(conn, con->pm_gc, XCB_GC_FOREGROUND, (uint32_t[]){ p->color->indicator }); - if (con_orientation(con->parent) == HORIZ) + if (p->parent_orientation == HORIZ) xcb_poly_fill_rectangle(conn, con->pixmap, con->pm_gc, 1, (xcb_rectangle_t[]){ - { r->width + br.width + br.x, 0, r->width, r->height + br.height } }); + { r->width + br.width + br.x, br.y, r->width, r->height + br.height } }); else xcb_poly_fill_rectangle(conn, con->pixmap, con->pm_gc, 1, (xcb_rectangle_t[]){ { br.x, r->height + br.height + br.y, r->width - (2 * br.x), r->height } }); @@ -478,10 +482,10 @@ void x_draw_decoration(Con *con) { int text_offset_y = (con->deco_rect.height - config.font.height) / 2; struct Window *win = con->window; - if (win == NULL || win->name_x == NULL) { + if (win == NULL || win->name == NULL) { /* this is a non-leaf container, we need to make up a good description */ // TODO: use a good description instead of just "another container" - draw_text("another container", strlen("another container"), false, + draw_text_ascii("another container", parent->pixmap, parent->pm_gc, con->deco_rect.x + 2, con->deco_rect.y + text_offset_y, con->deco_rect.width - 2); @@ -505,7 +509,7 @@ void x_draw_decoration(Con *con) { //DLOG("indent_level = %d, indent_mult = %d\n", indent_level, indent_mult); int indent_px = (indent_level * 5) * indent_mult; - draw_text(win->name_x, win->name_len, win->uses_net_wm_name, + draw_text(win->name, parent->pixmap, parent->pm_gc, con->deco_rect.x + 2 + indent_px, con->deco_rect.y + text_offset_y, con->deco_rect.width - 2 - indent_px); @@ -789,7 +793,7 @@ static void x_push_node_unmaps(Con *con) { } cookie = xcb_unmap_window(conn, con->frame); - DLOG("unmapping container (serial %d)\n", cookie.sequence); + DLOG("unmapping container %p / %s (serial %d)\n", con, con->name, cookie.sequence); /* we need to increase ignore_unmap for this container (if it * contains a window) and for every window "under" this one which * contains a window */ @@ -1027,9 +1031,11 @@ void x_set_name(Con *con, const char *name) { * */ void x_set_i3_atoms(void) { + pid_t pid = getpid(); xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root, A_I3_SOCKET_PATH, A_UTF8_STRING, 8, (current_socketpath == NULL ? 0 : strlen(current_socketpath)), current_socketpath); + xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root, A_I3_PID, XCB_ATOM_CARDINAL, 32, 1, &pid); xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root, A_I3_CONFIG_PATH, A_UTF8_STRING, 8, strlen(current_configpath), current_configpath); xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root, A_I3_SHMLOG_PATH, A_UTF8_STRING, 8,