focused_id = XCB_NONE;
con_focus(con_descend_focused(con));
tree_render();
-
- return;
}
/*
ungrab_all_keys(conn);
translate_keysyms();
grab_all_keys(conn);
-
- return;
}
/*
add_ignore_event(event->sequence, -1);
manage_window(event->window, cookie, false);
- return;
}
/*
if (config.focus_on_window_activation == FOWA_FOCUS || (config.focus_on_window_activation == FOWA_SMART && workspace_is_visible(ws))) {
DLOG("Focusing con = %p\n", con);
workspace_show(ws);
- con_focus(con);
+ con_activate(con);
tree_render();
} else if (config.focus_on_window_activation == FOWA_URGENT || (config.focus_on_window_activation == FOWA_SMART && !workspace_is_visible(ws))) {
DLOG("Marking con = %p urgent\n", con);
scratchpad_fix_resolution();
ipc_send_event("output", I3_IPC_EVENT_OUTPUT, "{\"change\":\"unspecified\"}");
-
- return;
}
/*
draw_util_copy_surface(&(parent->frame_buffer), &(parent->frame),
0, 0, 0, 0, parent->rect.width, parent->rect.height);
xcb_flush(conn);
- return;
}
#define _NET_WM_MOVERESIZE_SIZE_TOPLEFT 0
workspace_show(ws);
/* Re-set focus, even if unchanged from i3’s perspective. */
focused_id = XCB_NONE;
- con_focus(con);
+ con_activate(con);
}
} else {
/* Request is from an application. */
if (config.focus_on_window_activation == FOWA_FOCUS || (config.focus_on_window_activation == FOWA_SMART && workspace_is_visible(ws))) {
DLOG("Focusing con = %p\n", con);
workspace_show(ws);
- con_focus(con);
+ con_activate(con);
} else if (config.focus_on_window_activation == FOWA_URGENT || (config.focus_on_window_activation == FOWA_SMART && !workspace_is_visible(ws))) {
DLOG("Marking con = %p urgent\n", con);
con_set_urgency(con, true);
} else if (event->type == A_I3_SYNC) {
xcb_window_t window = event->data.data32[0];
uint32_t rnd = event->data.data32[1];
- DLOG("[i3 sync protocol] Sending random value %d back to X11 window 0x%08x\n", rnd, window);
-
- void *reply = scalloc(32, 1);
- xcb_client_message_event_t *ev = reply;
-
- ev->response_type = XCB_CLIENT_MESSAGE;
- ev->window = window;
- ev->type = A_I3_SYNC;
- ev->format = 32;
- ev->data.data32[0] = window;
- ev->data.data32[1] = rnd;
-
- xcb_send_event(conn, false, window, XCB_EVENT_MASK_NO_EVENT, (char *)ev);
- xcb_flush(conn);
- free(reply);
+ sync_respond(window, rnd);
} else if (event->type == A__NET_REQUEST_FRAME_EXTENTS) {
/*
* A client can request an estimate for the frame size which the window
Rect r = {
config.default_border_width, /* left */
config.default_border_width, /* right */
- config.font.height + 5, /* top */
+ render_deco_height(), /* top */
config.default_border_width /* bottom */
};
xcb_change_property(
*/
static void handle_focus_in(xcb_focus_in_event_t *event) {
DLOG("focus change in, for window 0x%08x\n", event->event);
+
+ if (event->event == root) {
+ DLOG("Received focus in for root window, refocusing the focused window.\n");
+ con_focus(focused);
+ focused_id = XCB_NONE;
+ x_push_changes(croot);
+ }
+
Con *con;
if ((con = con_by_window_id(event->event)) == NULL || con->window == NULL)
return;
if (ws != con_get_workspace(focused))
workspace_show(ws);
- con_focus(con);
+ con_activate(con);
/* We update focused_id because we don’t need to set focus again */
focused_id = event->event;
tree_render();
- return;
}
/*