Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed destination-is-ancestor check from container_move_to_container to match i3 behaviour #8356

Merged
merged 1 commit into from
Sep 21, 2024

Conversation

ccdunder
Copy link

Closes #6818

This extracts the specific part of #6835 that addresses the issue. I'm doing this since the original PR was closed over 2 years ago after the author got informal approval for this part of the change but pushback on other parts (not included here).

It removes this line

|| container_has_ancestor(container, destination)

In order to match the behaviour of i3's move functionality, which can be found here, posted below:

    /* We compare the focus order of the children of the lowest common ancestor. If con or
     * its ancestor is before target's ancestor then con should be placed before the target
     * in the focus stack. */
    Con *lca = lowest_common_ancestor(con, parent);
    if (lca == con) {
        ELOG(\"Container is being inserted into one of its descendants.\
\");
        return;
    }

Basically, sway is checking on move that a destination is neither a descendant of the container to be moved, and that the container to be moved is not a descendant of the destination, whereas i3 only (rightly, I think) checks that the destination is not a descendant, as such a lot of valid moves in i3 simply don't work in sway and this fixes that.

Copy link
Member

@Nefsen402 Nefsen402 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Nefsen402 Nefsen402 merged commit b6da218 into swaywm:master Sep 21, 2024
3 checks passed
@ccdunder ccdunder deleted the container_move_to_container branch October 3, 2024 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

container_move_to_container doesn't behave like it's i3 equivalent
3 participants