2FBILAASURBC6XQLU7Q4NOOTAZMWFFSIB66S4YHWJ5JHYEUAMJWQC D64WESJYNP7BT2GW7BX6332GAXIWK72KRIBEKTE34ATA4APJMGNQC UCSTVE5NIAIQ3NJL5YLDFDKDPOCJS6NMAGABSWG67RGCPH47JQEQC WGCCW4OP7UD6X3KZCUGSDAYHLXNUFM6D5HBVORSJS3YHYDJJH3VAC W32YIHMVPAREXUADJOAX45B6CTXZY42EE77RDDZYNJFEE2HLQ3HAC 7B74AT3BXYB7PVW4F6SGQNPMHOU5TEV5TZ54CG6VSQI46XSEKWXQC ZDQJLNDNDQPWEEWF2QZDRY5LZNJS653SDUQZDHK6EQPH7N4MHXUQC ZDQINUTDXQUS7OBW53UEYR6IN7DJLTPBOMRURGYQBGJ2FBROIQVAC MO5ORR7VSER3YUNO77DZJVKGOVYC2KNDCSC72J4NF7JYOHHTLRQAC /* XXX Need to understand xdg toplevel/popups to know if there's more* simplification that can be done in this function */prev_surface = seat->keyboard_state.focused_surface;/* Don't re-focus an already focused surface. *//* XXX need to move raiseclient before this */if (prev_surface == surface)return;if (prev_surface) {/** Deactivate the previously focused surface. This lets the* client know it no longer has focus and the client will* repaint accordingly, e.g. stop displaying a caret.*/previous = wlr_xdg_surface_from_wlr_surface(seat->keyboard_state.focused_surface);wlr_xdg_toplevel_set_activated(previous, 0);}/** 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. If surface == NULL, this will clear focus.*/kb = wlr_seat_get_keyboard(seat);wlr_seat_keyboard_notify_enter(seat, surface,kb->keycodes, kb->num_keycodes, &kb->modifiers);if (c) {
/* Activate the new surface */wlr_xdg_toplevel_set_activated(c->xdg_surface, 1);
}/** If the focused surface has changed, tell the seat to have the* keyboard enter the new surface. wlroots will keep track of this and* automatically send key events to the appropriate clients. If surface* is NULL, this will clear focus.*/if (surface != psurface) {kb = wlr_seat_get_keyboard(seat);wlr_seat_keyboard_notify_enter(seat, surface,kb->keycodes, kb->num_keycodes, &kb->modifiers);
/** If the focused toplevel has changed, deactivate the old one and* activate the new one. This lets the clients know to repaint* accordingly, e.g. show/hide a caret.*/if (tl != ptl && ptl)wlr_xdg_toplevel_set_activated(ptl, 0);if (tl != ptl && tl)wlr_xdg_toplevel_set_activated(tl, 1);