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;
}
/*
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
} 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(
}
if (prop == NULL) {
- prop = xcb_get_property_reply(conn, xcb_get_property_unchecked(conn,
- false, window, XCB_ATOM_WM_TRANSIENT_FOR, XCB_ATOM_WINDOW, 0, 32),
+ prop = xcb_get_property_reply(conn, xcb_get_property_unchecked(conn, false, window, XCB_ATOM_WM_TRANSIENT_FOR, XCB_ATOM_WINDOW, 0, 32),
NULL);
if (prop == NULL)
return false;
return false;
if (prop == NULL) {
- prop = xcb_get_property_reply(conn, xcb_get_property_unchecked(conn,
- false, window, A_WM_CLIENT_LEADER, XCB_ATOM_WINDOW, 0, 32),
+ prop = xcb_get_property_reply(conn, xcb_get_property_unchecked(conn, false, window, A_WM_CLIENT_LEADER, XCB_ATOM_WINDOW, 0, 32),
NULL);
if (prop == NULL)
return false;
*/
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;
/* We update focused_id because we don’t need to set focus again */
focused_id = event->event;
tree_render();
- return;
}
/*
return false;
if (prop == NULL) {
- prop = xcb_get_property_reply(conn, xcb_get_property_unchecked(conn,
- false, window, XCB_ATOM_WM_CLASS, XCB_ATOM_STRING, 0, 32),
+ prop = xcb_get_property_reply(conn, xcb_get_property_unchecked(conn, false, window, XCB_ATOM_WM_CLASS, XCB_ATOM_STRING, 0, 32),
NULL);
if (prop == NULL)
return false;
if (prop == NULL) {
- prop = xcb_get_property_reply(conn, xcb_get_property_unchecked(conn,
- false, window, A__MOTIF_WM_HINTS, XCB_GET_PROPERTY_TYPE_ANY, 0, 5 * sizeof(uint64_t)),
+ prop = xcb_get_property_reply(conn, xcb_get_property_unchecked(conn, false, window, A__MOTIF_WM_HINTS, XCB_GET_PROPERTY_TYPE_ANY, 0, 5 * sizeof(uint64_t)),
NULL);
if (prop == NULL)
struct property_handler_t *handler = NULL;
xcb_get_property_reply_t *propr = NULL;
- for (size_t c = 0; c < sizeof(property_handlers) / sizeof(struct property_handler_t); c++) {
+ for (size_t c = 0; c < NUM_HANDLERS; c++) {
if (property_handlers[c].atom != atom)
continue;