handlers.c: new focus should not end up behind fullscreen

This was raised here:
https://www.reddit.com/r/i3wm/comments/df18aa/popup_during_fullscreen_not_behaving_the_way_i/

With this commit, _NET_ACTIVE_WINDOW requests are more similar to
focusing with cmd_focus.
This commit is contained in:
Orestis Floros
2019-10-09 02:32:22 +03:00
parent 34c217acc8
commit 6f82d21c39
2 changed files with 20 additions and 11 deletions

View File

@ -412,7 +412,7 @@ static void handle_configure_request(xcb_configure_request_event_t *event) {
if (config.focus_on_window_activation == FOWA_FOCUS || (config.focus_on_window_activation == FOWA_SMART && workspace_is_visible(workspace))) {
DLOG("Focusing con = %p\n", con);
workspace_show(workspace);
con_activate(con);
con_activate_unblock(con);
tree_render();
} else if (config.focus_on_window_activation == FOWA_URGENT || (config.focus_on_window_activation == FOWA_SMART && !workspace_is_visible(workspace))) {
DLOG("Marking con = %p urgent\n", con);
@ -758,7 +758,7 @@ static void handle_client_message(xcb_client_message_event_t *event) {
workspace_show(ws);
/* Re-set focus, even if unchanged from i3s perspective. */
focused_id = XCB_NONE;
con_activate(con);
con_activate_unblock(con);
}
} else {
/* Request is from an application. */
@ -769,8 +769,7 @@ static void handle_client_message(xcb_client_message_event_t *event) {
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_activate(con);
con_activate_unblock(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);
@ -1115,14 +1114,8 @@ static void handle_focus_in(xcb_focus_in_event_t *event) {
DLOG("focus is different / refocusing floating window: updating decorations\n");
/* Get the currently focused workspace to check if the focus change also
* involves changing workspaces. If so, we need to call workspace_show() to
* correctly update state and send the IPC event. */
Con *ws = con_get_workspace(con);
if (ws != con_get_workspace(focused))
workspace_show(ws);
con_activate_unblock(con);
con_activate(con);
/* We update focused_id because we dont need to set focus again */
focused_id = event->event;
tree_render();