static void update_placeholder_contents(placeholder_state *state) {
xcb_change_gc(restore_conn, state->gc, XCB_GC_FOREGROUND,
- (uint32_t[]) {config.client.placeholder.background});
+ (uint32_t[]){config.client.placeholder.background});
xcb_poly_fill_rectangle(restore_conn, state->pixmap, state->gc, 1,
- (xcb_rectangle_t[]) {{0, 0, state->rect.width, state->rect.height}});
+ (xcb_rectangle_t[]){{0, 0, state->rect.width, state->rect.height}});
// TODO: make i3font functions per-connection, at least these two for now…?
xcb_flush(restore_conn);
static void open_placeholder_window(Con *con) {
if (con_is_leaf(con) &&
- (con->window == NULL || con->window->id == XCB_NONE)) {
+ (con->window == NULL || con->window->id == XCB_NONE) &&
+ !TAILQ_EMPTY(&(con->swallow_head)) &&
+ con->type == CT_CON) {
xcb_window_t placeholder = create_window(
restore_conn,
con->rect,
XCURSOR_CURSOR_POINTER,
true,
XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK,
- (uint32_t[]) {
+ (uint32_t[]){
config.client.placeholder.background,
XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_STRUCTURE_NOTIFY,
});
+ /* Make i3 not focus this window. */
+ xcb_icccm_wm_hints_t hints;
+ xcb_icccm_wm_hints_set_none(&hints);
+ xcb_icccm_wm_hints_set_input(&hints, 0);
+ xcb_icccm_set_wm_hints(restore_conn, placeholder, &hints);
/* Set the same name as was stored in the layout file. While perhaps
* slightly confusing in the first instant, this brings additional
* clarity to which placeholder is waiting for which actual window. */
- xcb_change_property(restore_conn, XCB_PROP_MODE_REPLACE, placeholder,
- A__NET_WM_NAME, A_UTF8_STRING, 8, strlen(con->name), con->name);
+ if (con->name != NULL)
+ xcb_change_property(restore_conn, XCB_PROP_MODE_REPLACE, placeholder,
+ A__NET_WM_NAME, A_UTF8_STRING, 8, strlen(con->name), con->name);
DLOG("Created placeholder window 0x%08x for leaf container %p / %s\n",
placeholder, con, con->name);
xcb_create_pixmap(restore_conn, root_depth, state->pixmap,
state->window, state->rect.width, state->rect.height);
state->gc = xcb_generate_id(restore_conn);
- xcb_create_gc(restore_conn, state->gc, state->pixmap, XCB_GC_GRAPHICS_EXPOSURES, (uint32_t[]) {0});
+ xcb_create_gc(restore_conn, state->gc, state->pixmap, XCB_GC_GRAPHICS_EXPOSURES, (uint32_t[]){0});
update_placeholder_contents(state);
TAILQ_INSERT_TAIL(&state_head, state, state);
Match *temp_id = smalloc(sizeof(Match));
match_init(temp_id);
temp_id->id = placeholder;
- TAILQ_INSERT_TAIL(&(con->swallow_head), temp_id, matches);
+ TAILQ_INSERT_HEAD(&(con->swallow_head), temp_id, matches);
}
Con *child;
xcb_create_pixmap(restore_conn, root_depth, state->pixmap,
state->window, state->rect.width, state->rect.height);
state->gc = xcb_generate_id(restore_conn);
- xcb_create_gc(restore_conn, state->gc, state->pixmap, XCB_GC_GRAPHICS_EXPOSURES, (uint32_t[]) {0});
+ xcb_create_gc(restore_conn, state->gc, state->pixmap, XCB_GC_GRAPHICS_EXPOSURES, (uint32_t[]){0});
update_placeholder_contents(state);
xcb_copy_area(restore_conn, state->pixmap, state->window, state->gc,