# window_set_active_pane

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

```c
int window_set_active_pane(struct window *w, struct window_pane *wp, int notify)
```

## Parameters

- `w` (`struct window *`)
- `wp` (`struct window_pane *`)
- `notify` (`int`)

## Called by

- [`cmd_attach_session`](/en/tmux/3.7c/reference/c-function-cmd_attach_session/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-attach-session.c#L95)
- [`cmd_join_pane_exec`](/en/tmux/3.7c/reference/c-function-cmd-join-pane-c-cmd_join_pane_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-join-pane.c#L127)
- [`cmd_resize_pane_mouse_update`](/en/tmux/3.7c/reference/c-function-cmd-resize-pane-c-cmd_resize_pane_mouse_update/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-resize-pane.c#L169)
- [`cmd_rotate_window_exec`](/en/tmux/3.7c/reference/c-function-cmd-rotate-window-c-cmd_rotate_window_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-rotate-window.c#L109)
- [`cmd_select_pane_exec`](/en/tmux/3.7c/reference/c-function-cmd-select-pane-c-cmd_select_pane_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-select-pane.c#L127)
- [`cmd_swap_pane_exec`](/en/tmux/3.7c/reference/c-function-cmd-swap-pane-c-cmd_swap_pane_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-swap-pane.c#L138)
- [`cmd_switch_client_exec`](/en/tmux/3.7c/reference/c-function-cmd-switch-client-c-cmd_switch_client_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-switch-client.c#L145)
- [`popup_make_pane`](/en/tmux/3.7c/reference/c-function-popup-c-popup_make_pane/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/popup.c#L450)
- [`server_client_check_mouse`](/en/tmux/3.7c/reference/c-function-server-client-c-server_client_check_mouse/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/server-client.c#L1004)
- [`spawn_pane`](/en/tmux/3.7c/reference/c-function-spawn_pane/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/spawn.c#L511)
- [`spawn_window`](/en/tmux/3.7c/reference/c-function-spawn_window/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/spawn.c#L115)
- [`window_copy_scroll`](/en/tmux/3.7c/reference/c-function-window_copy_scroll/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-copy.c#L637)
- [`window_zoom`](/en/tmux/3.7c/reference/c-function-window_zoom/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window.c#L733)

## Calls

- [`log_debug`](/en/tmux/3.7c/reference/c-function-log_debug/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window.c#L542)
- [`notify_window`](/en/tmux/3.7c/reference/c-function-notify_window/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window.c#L566)
- [`options_get_number`](/en/tmux/3.7c/reference/c-function-options_get_number/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window.c#L557)
- [`server_redraw_window`](/en/tmux/3.7c/reference/c-function-server_redraw_window/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window.c#L563)
- [`tty_update_window_offset`](/en/tmux/3.7c/reference/c-function-tty_update_window_offset/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window.c#L562)
- [`window_pane_stack_push`](/en/tmux/3.7c/reference/c-function-window_pane_stack_push/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window.c#L551)
- [`window_pane_stack_remove`](/en/tmux/3.7c/reference/c-function-window_pane_stack_remove/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window.c#L550)
- [`window_pane_update_focus`](/en/tmux/3.7c/reference/c-function-window_pane_update_focus/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window.c#L558)
- [`window_unzoom`](/en/tmux/3.7c/reference/c-function-window_unzoom/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window.c#L547)

## Referenced declarations

- [`window.active`](/en/tmux/3.7c/reference/c-struct-window-active/) (attribute)
- [`window_pane.active_point`](/en/tmux/3.7c/reference/c-struct-window_pane-active_point/) (attribute)
- [`window_pane.flags`](/en/tmux/3.7c/reference/c-struct-window_pane-flags/) (attribute)
- [`window.flags`](/en/tmux/3.7c/reference/c-struct-window-flags/) (attribute)
- [`global_options`](/en/tmux/3.7c/reference/c-variable-global_options/) (attribute)
- [`window_pane.id`](/en/tmux/3.7c/reference/c-struct-window_pane-id/) (attribute)
- [`window.last_panes`](/en/tmux/3.7c/reference/c-struct-window-last_panes/) (attribute)
- [`next_active_point`](/en/tmux/3.7c/reference/c-variable-window-c-next_active_point/) (attribute)
- [`PANE_CHANGED`](/en/tmux/3.7c/reference/c-define-tmux-h-pane_changed/) (constant)
- [`window`](/en/tmux/3.7c/reference/c-struct-window/) (struct)
- [`window_pane`](/en/tmux/3.7c/reference/c-struct-window_pane/) (struct)
- [`WINDOW_ZOOMED`](/en/tmux/3.7c/reference/c-define-tmux-h-window_zoomed/) (constant)
