mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2025-11-08 13:29:56 -05:00
feat: add dispatch focuslast
This commit is contained in:
parent
4f78c06515
commit
ba763332fc
3 changed files with 29 additions and 1 deletions
25
src/maomao.c
25
src/maomao.c
|
|
@ -4549,6 +4549,31 @@ void pending_kill_client(Client *c) {
|
|||
client_send_close(c);
|
||||
}
|
||||
|
||||
void focuslast(const Arg *arg) {
|
||||
|
||||
Client *c, *prev = NULL;
|
||||
wl_list_for_each(c, &fstack, flink) {
|
||||
if (c->iskilling || c->isminied || c->isunglobal)
|
||||
continue;
|
||||
if (c)
|
||||
break;
|
||||
}
|
||||
|
||||
struct wl_list *prev_node = c->flink.next;
|
||||
prev = wl_container_of(prev_node, prev, flink);
|
||||
|
||||
unsigned int target;
|
||||
if (prev) {
|
||||
if (prev->mon != selmon) {
|
||||
selmon = prev->mon;
|
||||
warp_cursor_to_selmon(selmon);
|
||||
}
|
||||
target = get_tags_first_tag(prev->tags);
|
||||
view(&(Arg){.ui = target}, true);
|
||||
focusclient(prev, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void killclient(const Arg *arg) {
|
||||
Client *c;
|
||||
c = selmon->sel;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue