Raise floating window to top when it gets focus
Applied for: 1. '[...] focus' for a floating container raises it to the top. 2. Focusing a window through a focus event raises it to the top. Fixes #2572
This commit is contained in:
@ -1221,7 +1221,9 @@ static void handle_focus_in(xcb_focus_in_event_t *event) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (focused_id == event->event) {
|
||||
/* Floating windows should be refocused to ensure that they are on top of
|
||||
* other windows. */
|
||||
if (focused_id == event->event && !con_inside_floating(con)) {
|
||||
DLOG("focus matches the currently focused window, not doing anything\n");
|
||||
return;
|
||||
}
|
||||
@ -1232,7 +1234,7 @@ static void handle_focus_in(xcb_focus_in_event_t *event) {
|
||||
return;
|
||||
}
|
||||
|
||||
DLOG("focus is different, updating decorations\n");
|
||||
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
|
||||
@ -1244,7 +1246,7 @@ static void handle_focus_in(xcb_focus_in_event_t *event) {
|
||||
con_focus(con);
|
||||
/* We update focused_id because we don’t need to set focus again */
|
||||
focused_id = event->event;
|
||||
x_push_changes(croot);
|
||||
tree_render();
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user