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

splitv is not working as expected #8546

Open
bhepple opened this issue Jan 26, 2025 · 0 comments
Open

splitv is not working as expected #8546

bhepple opened this issue Jan 26, 2025 · 0 comments
Labels
bug Not working as intended

Comments

@bhepple
Copy link

bhepple commented Jan 26, 2025

  • Sway Version:
    1.10

  • Debug Log:

    • Run sway -d 2> ~/sway.log from a TTY and upload it to a pastebin, such as gist.github.com.

... the log is empty

  • Configuration File:

I ran with -c /etc/sway/config

  • Description:

I have a script i3-set-layout that rearranges existing windows in a grid pattern. It works under i3wm but fails under sway.

eg with 4 windows, i3wm puts them in a grid with 2 columns but sway arranges them horizontally.

It appears that the splitv command is not working as under i3wm.

To illustrate what's going on, the script outputs the swaymsg calls and the resulting workspace representation:

$ i3-set-layout g 2
# it first moves all windows off to an empty workspace:
swaymsg [con_id=7] fullscreen disable, move to workspace 20
swaymsg [con_id=8] fullscreen disable, move to workspace 20
swaymsg [con_id=14] fullscreen disable, move to workspace 20
swaymsg [con_id=15] fullscreen disable, move to workspace 20
# now it arranges the splits and brings them back again to the current workspace:
swaymsg focus parent
swaymsg layout splith
swaymsg [con_id=15] move to workspace current, focus
H[foot]
swaymsg split h
H[foot]
swaymsg [con_id=7] move to workspace current, focus
H[foot foot]
swaymsg focus parent, split v
V[H[foot foot]]
swaymsg [con_id=8] move to workspace current, focus
V[H[foot foot foot]]                          ****** FAIL AT THIS POINT - i3 gives V[H[xterm xterm] xterm]
swaymsg split h
V[H[foot foot H[foot]]]                    ****** i3 gives V[H[xterm xterm]H[xterm]]
swaymsg [con_id=14] move to workspace current, focus
V[H[foot foot H[foot foot]]]           ****** i3 gives V[H[xterm xterm]H[xterm xterm]] which is the correct 2x2 grid

Oddly, if one starts with a blank workspace and creates 4 new windows with appropriate splitting using the key bindings, it works!

$mod+Enter
$mod+b
$mod+Enter
$mod+a
$mod+v
$mod+Enter
$mod+b
$mod+Enter

But I want to rearrange existing windows.

@bhepple bhepple added the bug Not working as intended label Jan 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not working as intended
Development

No branches or pull requests

1 participant