# libtmux::Window::next_layout

- **Module:** libtmux::Window
- **Package:** libtmux-cxx
- **Language:** C++
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-cxx/blob/85e8bd603a322dc32bb8b9aeb1a72bcf36945f1d/include/libtmux/entities.hpp#L496
- **Page:** https://libtmux.org/reference/cxx/libtmux-window-next_layout/

```
libtmux::Window::next_layout() -> expected< void, CommandFailure >
```

Exchange positions with another window, keeping both ids.

Step through tmux's preset arrangements, and turn the panes within the one in use.

The layouts are tmux's list, not a caller's: asking for "the next one" is the only way to reach them without naming each. Rotating is a different act — it moves which pane occupies which cell and leaves the cells where they are.

None of the three refuses a window holding a single pane. tmux accepts all of them there and changes nothing, which is worth knowing before treating success as evidence that something moved.
