*/
void client_warp_pointer_into(xcb_connection_t *conn, Client *client);
+/**
+ * Returns true if the client supports the given protocol atom (like WM_DELETE_WINDOW)
+ *
+ */
+bool client_supports_protocol(xcb_connection_t *conn, Client *client, xcb_atom_t atom);
+
/**
* Kills the given window using WM_DELETE_WINDOW or xcb_kill_window
*
* one. Therefore, this flag is set when reparenting. */
bool awaiting_useless_unmap;
+ /* Whether the client needs WM_TAKE_FOCUS */
+ bool needs_take_focus;
+
/* XCB contexts */
xcb_window_t frame; /**< Our window: The frame around the
* client */
* Returns true if the client supports the given protocol atom (like WM_DELETE_WINDOW)
*
*/
-static bool client_supports_protocol(xcb_connection_t *conn, Client *client, xcb_atom_t atom) {
+bool client_supports_protocol(xcb_connection_t *conn, Client *client, xcb_atom_t atom) {
xcb_get_property_cookie_t cookie;
xcb_icccm_get_wm_protocols_reply_t protocols;
bool result = false;
redecorate_window(conn, new);
}
+ new->needs_take_focus = client_supports_protocol(conn, new, A_WM_TAKE_FOCUS);
new->initialized = true;
/* Check if the window already got the fullscreen hint set */
}
if (new->container == CUR_CELL || client_is_floating(new)) {
xcb_set_input_focus(conn, XCB_INPUT_FOCUS_POINTER_ROOT, new->child, XCB_CURRENT_TIME);
- take_focus(conn, new);
+ if (new->needs_take_focus)
+ take_focus(conn, new);
ewmh_update_active_window(new->child);
}
}
CLIENT_LOG(client);
/* Set focus to the entered window, and flush xcb buffer immediately */
xcb_set_input_focus(conn, XCB_INPUT_FOCUS_POINTER_ROOT, client->child, XCB_CURRENT_TIME);
- take_focus(conn, client);
+ if (client->needs_take_focus)
+ take_focus(conn, client);
ewmh_update_active_window(client->child);
//xcb_warp_pointer(conn, XCB_NONE, client->child, 0, 0, 0, 0, 10, 10);