X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fhandlers.c;h=c80c279efe43857b83e9a4e4246e72f3681dc5cb;hb=9bf161710b20238d377e8f14c29539e8d7e16e82;hp=4b5c87d4fd0651db363b8bea27e1c9507cd1fb0c;hpb=00e86c4de4f42ac4e6fff88fa938ef9dff6387e6;p=i3%2Fi3 diff --git a/src/handlers.c b/src/handlers.c index 4b5c87d4..c80c279e 100644 --- a/src/handlers.c +++ b/src/handlers.c @@ -743,16 +743,17 @@ static void handle_client_message(xcb_client_message_event_t *event) { workspace_show(ws); con_focus(con); } else { - /* If the request is from an application, only focus if the - * workspace is visible. Otherwise set the urgency hint. */ - if (workspace_is_visible(ws)) { - DLOG("Request to focus con on a visible workspace. Focusing con = %p\n", con); + /* 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); - } else { - DLOG("Request to focus con on a hidden workspace. Setting urgent con = %p\n", 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 + DLOG("Ignoring request for con = %p", con); } tree_render(); @@ -874,12 +875,16 @@ static void handle_client_message(xcb_client_message_event_t *event) { .root_y = y_root, .event_x = x_root - (con->rect.x), .event_y = y_root - (con->rect.y)}; - if (direction == _NET_WM_MOVERESIZE_MOVE) { - floating_drag_window(con->parent, &fake); - } else if (direction >= _NET_WM_MOVERESIZE_SIZE_TOPLEFT && direction <= _NET_WM_MOVERESIZE_SIZE_LEFT) { - floating_resize_window(con->parent, FALSE, &fake); - } else { - DLOG("_NET_WM_MOVERESIZE direction %d not implemented\n", direction); + switch (direction) { + case _NET_WM_MOVERESIZE_MOVE: + floating_drag_window(con->parent, &fake); + break; + case _NET_WM_MOVERESIZE_SIZE_TOPLEFT... _NET_WM_MOVERESIZE_SIZE_LEFT: + floating_resize_window(con->parent, FALSE, &fake); + break; + default: + DLOG("_NET_WM_MOVERESIZE direction %d not implemented\n", direction); + break; } } else { DLOG("unhandled clientmessage\n"); @@ -1214,7 +1219,7 @@ static bool handle_strut_partial_change(void *data, xcb_connection_t *conn, uint con->window->dock = W_DOCK_BOTTOM; } else { DLOG("Ignoring invalid reserved edges (_NET_WM_STRUT_PARTIAL), using position as fallback:\n"); - if (con->geometry.y < (int16_t)(search_at->rect.height / 2)) { + if (con->geometry.y < (search_at->rect.height / 2)) { DLOG("geom->y = %d < rect.height / 2 = %d, it is a top dock client\n", con->geometry.y, (search_at->rect.height / 2)); con->window->dock = W_DOCK_TOP;