fixed focus
This commit is contained in:
parent
80ae2a7774
commit
cd0cdc28aa
|
@ -223,16 +223,20 @@ void unfocus_all(swayc_t *container) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void focus_view(swayc_t *view) {
|
void focus_view(swayc_t *view) {
|
||||||
sway_log(L_DEBUG, "Setting focus to %p", view);
|
sway_log(L_DEBUG, "Setting focus for %p", view);
|
||||||
if (view->type == C_VIEW) {
|
if (view == &root_container) {
|
||||||
wlc_view_set_state(view->handle, WLC_BIT_ACTIVATED, true);
|
// Propegate wayland focus down
|
||||||
wlc_view_bring_to_front(view->handle);
|
swayc_t *child = view->focused;
|
||||||
wlc_view_focus(view->handle);
|
while (child && child->type != C_VIEW) {
|
||||||
|
child = child->focused;
|
||||||
|
}
|
||||||
|
if (child) {
|
||||||
|
wlc_view_set_state(child->handle, WLC_BIT_ACTIVATED, true);
|
||||||
|
wlc_view_focus(child->handle);
|
||||||
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
// Propagete focus up
|
|
||||||
while (view != &root_container) {
|
|
||||||
view->parent->focused = view;
|
view->parent->focused = view;
|
||||||
view = view->parent;
|
focus_view(view->parent);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue