mirror of
https://github.com/swaywm/sway.git
synced 2024-11-26 09:51:29 +00:00
fixed focus
This commit is contained in:
parent
cd0cdc28aa
commit
f3a970e24e
|
@ -223,20 +223,17 @@ void unfocus_all(swayc_t *container) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void focus_view(swayc_t *view) {
|
void focus_view(swayc_t *view) {
|
||||||
sway_log(L_DEBUG, "Setting focus for %p", view);
|
sway_log(L_DEBUG, "Setting focus for %p", view);
|
||||||
if (view == &root_container) {
|
while (view != &root_container) {
|
||||||
// Propegate wayland focus down
|
view->parent->focused = view;
|
||||||
swayc_t *child = view->focused;
|
view = view->parent;
|
||||||
while (child && child->type != C_VIEW) {
|
}
|
||||||
child = child->focused;
|
while (view && view->type != C_VIEW) {
|
||||||
}
|
view = view->focused;
|
||||||
if (child) {
|
}
|
||||||
wlc_view_set_state(child->handle, WLC_BIT_ACTIVATED, true);
|
if (view) {
|
||||||
wlc_view_focus(child->handle);
|
wlc_view_set_state(view->handle, WLC_BIT_ACTIVATED, true);
|
||||||
}
|
wlc_view_focus(view->handle);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
view->parent->focused = view;
|
|
||||||
focus_view(view->parent);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue