Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/bindings/keys.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ bindr=Super,Super_L,spawn,rofi -show run
| `focusdir` | `left/right/up/down` | Focus window in direction. |
| `focus_window_or_workspace` | `left/right/up/down` | Focus window in direction or switch to next/previous workspace. |
| `focusstack` | `next/prev` | Cycle focus within the stack. |
| `focus_first_tiled` | - | Focus the first visible tiled window in layout order. |
| `focuslast` | - | Focus the previously active window. |
| `exchange_client` | `left/right/up/down` | Swap window with neighbor in direction. |
| `exchange_stack_client` | `next/prev` | Exchange window position in stack. |
Expand Down
2 changes: 2 additions & 0 deletions src/config/parse_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,8 @@ FuncType parse_func_name(char *func_name, Arg *arg, char *arg_value,
if (strcmp(func_name, "focusstack") == 0) {
func = focusstack;
(*arg).i = parse_circle_direction(arg_value);
} else if (strcmp(func_name, "focus_first_tiled") == 0) {
func = focus_first_tiled;
} else if (strcmp(func_name, "groupfocus") == 0) {
func = groupfocus;
(*arg).i = parse_circle_direction(arg_value);
Expand Down
1 change: 1 addition & 0 deletions src/dispatch/bind_declare.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ void toggleglobal(const Arg *arg);
void incnmaster(const Arg *arg);
void focusmon(const Arg *arg);
void focusstack(const Arg *arg);
void focus_first_tiled(const Arg *arg);
void groupfocus(const Arg *arg);
void chvt(const Arg *arg);
void reload_config(const Arg *arg);
Expand Down
20 changes: 20 additions & 0 deletions src/dispatch/bind_define.h
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,26 @@ void focusstack(const Arg *arg) {
return;
}

void focus_first_tiled(const Arg *arg) {
Client *c = NULL;

if (!selmon || !selmon->pertag->ltidxs[selmon->pertag->curtag]->arrange)
return;

wl_list_for_each(c, &clients, link) {
if (VISIBLEON(c, selmon) && ISFAKETILED(c))
break;
}

if (&c->link == &clients || c == selmon->sel)
return;

focusclient(c, 1);
if (config.warpcursor)
warp_cursor(c);
return;
}

void groupfocus(const Arg *arg) {
Client *c = arg->tc ? arg->tc : selmon->sel;
if (!c || !c->mon)
Expand Down