cycle_active_window(&win_meta, 'n');
else if (key == get_action_key(world.keybindings, "cycle backwards"))
cycle_active_window(&win_meta, 'p');
- else if (key == get_action_key(world.keybindings, "shift forwards") && win_meta.active != 0)
+ else if (key == get_action_key(world.keybindings, "shift forwards"))
shift_window(&win_meta, 'f');
- else if (key == get_action_key(world.keybindings, "shift backwards") && win_meta.active != 0)
+ else if (key == get_action_key(world.keybindings, "shift backwards"))
shift_window(&win_meta, 'b');
else if (key == get_action_key(world.keybindings, "grow horizontally") && win_meta.active != 0)
resize_window(&win_meta, '*');
void shift_window (struct WinMeta * win_meta, char dir) {
// Move active window forward/backward in window chain. If jumping beyond start/end, move to other chain end.
- if (win_meta->chain_start != win_meta->chain_end && (dir == 'f' || dir == 'b')) {
+ if (0 != win_meta->active && win_meta->chain_start != win_meta->chain_end && (dir == 'f' || dir == 'b')) {
int i, i_max;
struct Win * win_shift = win_meta->active;
char wrap = 0;