aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/seatop_default.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/input/seatop_default.c')
-rw-r--r--sway/input/seatop_default.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/sway/input/seatop_default.c b/sway/input/seatop_default.c
index fc785cda..9cf58c47 100644
--- a/sway/input/seatop_default.c
+++ b/sway/input/seatop_default.c
@@ -439,18 +439,17 @@ static void check_focus_follows_mouse(struct sway_seat *seat,
439 return; 439 return;
440 } 440 }
441 441
442 if (node_is_view(hovered_node)) { 442 // This is where we handle the common case. We don't want to focus inactive
443 // tabs, hence the view_is_visible check.
444 if (node_is_view(hovered_node) &&
445 view_is_visible(hovered_node->sway_container->view)) {
446 // e->previous_node is the node which the cursor was over previously.
447 // If focus_follows_mouse is yes and the cursor got over the view due
448 // to, say, a workspace switch, we don't want to set the focus.
449 // But if focus_follows_mouse is "always", we do.
443 if (hovered_node != e->previous_node || 450 if (hovered_node != e->previous_node ||
444 config->focus_follows_mouse == FOLLOWS_ALWAYS) { 451 config->focus_follows_mouse == FOLLOWS_ALWAYS) {
445 seat_set_focus(seat, hovered_node); 452 seat_set_focus(seat, hovered_node);
446 } else {
447 // Focusing a tab which contains a split child
448 struct sway_node *next_focus =
449 seat_get_focus_inactive(seat, &root->node);
450 if (next_focus && node_is_view(next_focus) &&
451 view_is_visible(next_focus->sway_container->view)) {
452 seat_set_focus(seat, next_focus);
453 }
454 } 453 }
455 } 454 }
456} 455}