focus(NULL, NULL) works like dwm's focus(NULL): focus the most recent visible client on selmon, or clear the existing focus if there are none.
ZDQINUTDXQUS7OBW53UEYR6IN7DJLTPBOMRURGYQBGJ2FBROIQVAC QL6IFEPOHHUDBY2SGUZNNIRTDSZOSRJIHJKVU54LZSGTPTFPM2UAC CD2JEM3MH5BXN7ADZAWLJFTRZG7PMDCKISDNJEO472PIBEJHBH2AC O5JVMDEEKP334BAYMJ6HHXROW4X4WC24JHCYZTKJRQE5UGYXV7YQC 7B74AT3BXYB7PVW4F6SGQNPMHOU5TEV5TZ54CG6VSQI46XSEKWXQC J6OSBEBQXZR5JZ5TOCCUPELBPUVEQULGCXURXLPY7WFYTDEQOU2AC E7UO6NRGXFDMBU3BSJYRDNOA3Y7VHD7NWPHI5PHCPHQF6ZNOPZLQC S7RXJJZG4IEIVLPHEWFT5M2T3SRRO5US5SYBPXSYSWJJLXAKNNPAC KH2HI5AHY3PLRXYTLX5U5IPCOLTOABOLF6EPSMPRU42ZCWOSRSMAC MMCQLXIFYBYY3MTEIZDI7SI7D4QN4NM7EIGYGHFA43IN7NOERBLAC D425ND7AT3F7QJ3CCSESMVDOC3J5C5P32M5SJDBHECZJXLHNQ2FAC HW2YJWC6AUWHZBS7KHF3PAWN44XGWSJ5WU47MCHTDCH32L5JN7EQC 6XZIQSMIVP2GZ5S3UCKEVNDSLTHSQEVSXLV4UIFF3G3SRCGJPXYAC /* Note: this function only deals with keyboard focus. */if (c == NULL) {return;
/* Default client is most recently focused on selmon */if (!c || !VISIBLEON(c, c->mon)) {c = NULL;surface = NULL;Client *next;wl_list_for_each(next, &fstack, flink) {if (VISIBLEON(next, selmon)) {c = next;break;}}
struct wlr_keyboard *keyboard = wlr_seat_get_keyboard(seat);/* Move the client to the front of the focus stack */wl_list_remove(&c->flink);wl_list_insert(&fstack, &c->flink);/* Activate the new surface */wlr_xdg_toplevel_set_activated(c->xdg_surface, true);/** Tell the seat to have the keyboard enter this surface. wlroots will keep* track of this and automatically send key events to the appropriate* clients without additional work on your part.*/wlr_seat_keyboard_notify_enter(seat, c->xdg_surface->surface,keyboard->keycodes, keyboard->num_keycodes, &keyboard->modifiers);
if (c) {struct wlr_keyboard *keyboard = wlr_seat_get_keyboard(seat);/* Move the client to the front of the focus stack */wl_list_remove(&c->flink);wl_list_insert(&fstack, &c->flink);/* Activate the new surface */wlr_xdg_toplevel_set_activated(c->xdg_surface, true);/** Tell the seat to have the keyboard enter this surface.* wlroots will keep track of this and automatically send key* events to the appropriate clients without additional work on* your part.*/wlr_seat_keyboard_notify_enter(seat, c->xdg_surface->surface,keyboard->keycodes, keyboard->num_keycodes,&keyboard->modifiers);} else {wlr_seat_keyboard_clear_focus(seat);}