|
|
|
@ -224,19 +224,16 @@ void unfocus_all(swayc_t *container) {
|
|
|
|
|
|
|
|
|
|
void focus_view(swayc_t *view) {
|
|
|
|
|
sway_log(L_DEBUG, "Setting focus for %p", view);
|
|
|
|
|
if (view == &root_container) {
|
|
|
|
|
// Propegate wayland focus down
|
|
|
|
|
swayc_t *child = view->focused;
|
|
|
|
|
while (child && child->type != C_VIEW) {
|
|
|
|
|
child = child->focused;
|
|
|
|
|
while (view != &root_container) {
|
|
|
|
|
view->parent->focused = view;
|
|
|
|
|
view = view->parent;
|
|
|
|
|
}
|
|
|
|
|
if (child) {
|
|
|
|
|
wlc_view_set_state(child->handle, WLC_BIT_ACTIVATED, true);
|
|
|
|
|
wlc_view_focus(child->handle);
|
|
|
|
|
while (view && view->type != C_VIEW) {
|
|
|
|
|
view = view->focused;
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
if (view) {
|
|
|
|
|
wlc_view_set_state(view->handle, WLC_BIT_ACTIVATED, true);
|
|
|
|
|
wlc_view_focus(view->handle);
|
|
|
|
|
}
|
|
|
|
|
view->parent->focused = view;
|
|
|
|
|
focus_view(view->parent);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|