swaywm / sway

i3-compatible Wayland compositor
https://swaywm.org
MIT License
14.57k stars 1.11k forks source link

no_focus on first window in tabbed layout #7322

Open vicencb opened 1 year ago

vicencb commented 1 year ago
vicencb commented 1 year ago

This fixes the issue, but i don't know the meaning of view->container->pending.parent and no extensive tests performed, so, please, review.

--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -639,7 +639,7 @@ static bool should_focus(struct sway_view *view) {

    // If the view is the only one in the focused workspace, it'll get focus
    // regardless of any no_focus criteria.
-   if (!view->container->pending.parent && !prev_con) {
+   if (!prev_con) {
        size_t num_children = view->container->pending.workspace->tiling->length +
            view->container->pending.workspace->floating->length;
        if (num_children == 1) {