Fix behaviour of container_move_to_container, add move to con_id #6835
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #6818
Okay so this PR does two things:
One, it removes this line
sway/sway/commands/move.c
Line 235 in f707f58
In order to match the behaviour of i3's move functionality, which can be found here, posted below:
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.
The second, sort of incidental thing this PR adds is the command
move [container|window] [to] con_id <con_id>
. I use a script with a lot of "macros" to make navigating formerly-i3-and-now-sway easier, and I noticed that in decently upwards of half of them they all have the same repeated behaviour:or something similar, so it seemed like there was a very obvious use case to just have that be
All of the rules surrounding whether a move is valid and how the move functions are identical to move-to-mark, this just saves some steps if you happen to have a con_id handy.
So yeah! Let me know what you think.