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

Implement split none command #4935

Merged
merged 1 commit into from
Sep 3, 2021
Merged

Implement split none command #4935

merged 1 commit into from
Sep 3, 2021

Conversation

rpigott
Copy link
Member

@rpigott rpigott commented Jan 22, 2020

While browsing the i3 issue tracker I saw issue i3/i3#3808 "split none" command with an accepted label.

Not sure if we want it yet, but I figured this one was pretty easy to implement for sway so here it is. i3 doesn't have an implementation yet, so I can't really compare it to theirs, but I expect this is the intended behavior.

Copy link
Member

@RedSoxFan RedSoxFan left a comment

Choose a reason for hiding this comment

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

The workspace needs to be arranged after the flatten. Reference the do_split function at the top of the file:

if (root->fullscreen_global) {
arrange_root();
} else {
arrange_workspace(ws);
}

Since this is for i3 compatibility, this should not be merged until the feature lands in i3 master. This is especially important since there is no active PR to mirror the behavior against. The linked i3 issue also suggests rejecting the command (CMD_FAILURE) when there are siblings, which isn't currently implemented in this PR.

sway/commands/split.c Outdated Show resolved Hide resolved
@rpigott
Copy link
Member Author

rpigott commented Jul 25, 2020

Just updated since this was stale and had a conflict. No change in the i3 situation AFAIK.

@emersion emersion requested a review from RedSoxFan July 27, 2020 08:41
Copy link
Member

@RedSoxFan RedSoxFan left a comment

Choose a reason for hiding this comment

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

Code LGTM. Not sure if this should be merged yet.

@scippio

This comment has been minimized.

@jhonrocha
Copy link

Hey! i3 currently have a workaround for this: https://www.youtube.com/watch?v=AWA8Pl57UBY&t=278s
However, I am not able to reproduce that behavior on sway, trying to move a single child against its parent is actually moving the parent towards the selected direction. Is there a way to reproduce that?

@rpigott
Copy link
Member Author

rpigott commented Mar 17, 2021

@jhonrocha That should be fixed in master. If not, please file a new bug for it. i3 has entered a feature freeze and I'm not sure of the status of this feature for i3.

@WhyNotHugo
Copy link
Contributor

Is there something blocking this from being merged?

@Xyene
Copy link
Member

Xyene commented Aug 27, 2021

The i3 feature is not implemented, so this is blocked on that.

@emersion
Copy link
Member

The risk here is to merge something which becomes incompatible with what i3 ends up merging.

@tamirzb
Copy link
Contributor

tamirzb commented Aug 27, 2021

@emersion I'm curious, why not merge this and then worst case if i3 ever ends up merging something different also add compatibility for that? sway already has features that i3 doesn't have, which risks i3 merging something incompatible with them some day in the future.

@emersion
Copy link
Member

The i3 devs have given a provisional ACK for this API. I'd be fine with merging even if there's a risk we need to add back compat for i3 later. This is a pretty small feature.

@rpigott
Copy link
Member Author

rpigott commented Sep 3, 2021

I'm fine with merging this. I think its unlikely for i3 to merge an incompatible feature, and even if they do it's unlikely to be a disaster if we change ours to match.

@emersion
Copy link
Member

emersion commented Sep 3, 2021

Alright, let's do this then, thanks!

@emersion emersion merged commit de3c290 into swaywm:master Sep 3, 2021
@rpigott rpigott deleted the split_none branch September 3, 2021 21:52
@rpigott
Copy link
Member Author

rpigott commented Sep 3, 2021

@emersion Uh, this doesn't actually build. I guess the CI hadn't been run in ages and it was never updated for a047b5e.

@sim590
Copy link

sim590 commented Sep 8, 2021

How is this supposed to work? I tried:

bindsym $mod+u split none

But it just didn't change anything. The V marker in front of the window title indicating that the window is in vertical split mode is still there. Isn't split none supposed to remove it so that the next window I spawn is under the same parent as the focused window?

Version info

sway version 1.6-e76e13ef

@rpigott
Copy link
Member Author

rpigott commented Sep 9, 2021

Isn't split none supposed to remove it so that the next window I spawn is under the same parent as the focused window?

That sounds right. It will only work on singleton containers though, so if you've spawned another window already it will do nothing. Maybe try running swaymsg split none in your terminal from that configuration and see if it reports an error?

EDIT: btw, swaymsg -t get_workspaces will show you the full workspace representation which is useful for unambiguously communicating layouts.

@sim590
Copy link

sim590 commented Sep 9, 2021

@rpigott : you're right. If I remove the windows from the container, it seems to work. That's what I was missing I think!

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.

None yet

9 participants