-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
container_move_to_container
doesn't behave like it's i3 equivalent
#6818
Comments
Okay actually looks like the above isn't entirely accurate, the focus does remain on the correct container as it's moved, but the actual screen itself doesn't move with it, so for instance in a tabbed situation if I move a focused container into a child container, I'm left looking at a different tab without focus, and the focus goes into the non-visible container. |
Right, so I'm not going to pretend to grasp this fully but I think I've tracked down at least the issue regarding the "macro" in the script. So in the move command here: Lines 232 to 238 in f707f58
It's checking both that the destination is not a descendant of the container and that the container is not a descendant of the destination. Meanwhile, what I'm like 90% sure is the equivalent bit of code in i3 here (Apparently I can't embed lines from other repos) /* 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.\n");
return;
} Only checks that the container being moved is not an ancestor of it's destination. So I pulled source and just commented out |
move window to mark <mark>
is usually not doing anything, and when it does, it does the wrong thingcontainer_move_to_container
doesn't behave like it's i3 equivalent
Right, so I've not had a lot of time to work on this, but some other things I've noticed and have been trying to address in the previously mentioned PR,
where
and
where
with |
Getting back to this, and I've realized that you can circumvent the ancestor check by first moving the container to a temporary workspace, then moving it to your desired location. As long as it's happening in a single sequenced command, the workspace never shows up on screen. For example:
There's still the issue that |
i have same problem on sway v1.8 |
I'm not sure that I've fully followed the issue preventing sway following the same move-to-mark logic as i3, but @Myrdden |
#8356 seems a partial fix. It makes it possible to move a child up in the tree, but it always makes it the last sibling/uncle, rather than the nearest sibling/uncle as in i3. Example:
Expected behavior (matches i3): there are 4 tabs, the child has become the 2nd tab. Actual behavior: there are 4 tabs, the child has become the 4th tab. Happy to take a crack at this if anyone has a suggestion as to how at a high-level. |
I whipped up a solution in #8418. I would greatly appreciate feedback on the general approach. The one remaining issue is that this won't work for moving a container up to the workspace, because a workspace can't be marked and treated like a container in sway like in i3. My guess is that changing that would be a more involved change? Thank you in advance for guidance, maintainers! |
Sway Version: 1.7
Logs: here
I'm migrating here from i3 because X just slowly descended into graphical madness, I have a few keybindings which call a script. The relevant one to this is:
Where
nodePath
makes an array of each container down to the focused node, so[-3]
of that is the "grandparent" (parent's parent). So it takes a window, and then makes it a child of it's parent's parent, thus moving it up the tree one level. This works fine on i3, and does absolutely nothing when used in sway. There's no error, the log says it's running the command, but nothing happens. When I go into a console and try to dispatch that set of commands manually withswaymsg
, it also doesn't do anything. The issue doesn't appear to lie further down in the tree fetching or anything, because when inspecting the command as it runs the value of$parent
is consistent and correct, the subsequent commands just aren't doing anything. (Well, sometimes it will actually place the mark, which can be seen by removing the unmark bit, but even then this extremely is inconsistent)And, while we're here, when I try to move containers to marks in other ways, it's seemingly random and sporadic whether it will work or not. I think it might be failing to do anything whenever the marked container is a direct ancestor of the focused one, but I'm not entirely certain on that. But also, when it does work, the container being moved always loses focus, which is not how the same command behaves in i3.
The text was updated successfully, but these errors were encountered: