# window_tree_swap

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L820
- **Page:** https://libtmux.org/en/tmux/3.7c/reference/c-function-window-tree-c-window_tree_swap/

```c
static int window_tree_swap(void *cur_itemdata, void *other_itemdata, struct sort_criteria *sort_crit)
```

## Parameters

- `cur_itemdata` (`void *`)
- `other_itemdata` (`void *`)
- `sort_crit` (`struct sort_criteria *`)

## Calls

- [`recalculate_sizes`](/en/tmux/3.7c/reference/c-function-recalculate_sizes/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L865)
- [`server_redraw_session_group`](/en/tmux/3.7c/reference/c-function-server_redraw_session_group/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L864)
- [`session_group_synchronize_from`](/en/tmux/3.7c/reference/c-function-session_group_synchronize_from/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L863)
- [`session_set_current`](/en/tmux/3.7c/reference/c-function-session_set_current/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L860)
- [`sort_would_window_tree_swap`](/en/tmux/3.7c/reference/c-function-sort_would_window_tree_swap/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L846)
- [`window_tree_pull_item`](/en/tmux/3.7c/reference/c-function-window-tree-c-window_tree_pull_item/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L835)

## Referenced by

- [`window_tree_init`](/en/tmux/3.7c/reference/c-function-window-tree-c-window_tree_init/) (function)

## Referenced declarations

- [`session.curw`](/en/tmux/3.7c/reference/c-struct-session-curw/) (attribute)
- [`sort_criteria`](/en/tmux/3.7c/reference/c-struct-sort_criteria/) (struct)
- [`window_tree_itemdata.type`](/en/tmux/3.7c/reference/c-struct-window_tree_itemdata-type/) (attribute)
- [`winlink.window`](/en/tmux/3.7c/reference/c-struct-winlink-window/) (attribute)
- [`WINDOW_TREE_WINDOW`](/en/tmux/3.7c/reference/c-enum-window_tree_type-window_tree_window/) (constant)
- [`window.winlinks`](/en/tmux/3.7c/reference/c-struct-window-winlinks/) (attribute)
