mirror of
https://github.com/swaywm/sway.git
synced 2024-11-29 03:11:27 +00:00
commit
f7f739c057
|
@ -223,16 +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 to %p", view);
|
sway_log(L_DEBUG, "Setting focus for %p", view);
|
||||||
if (view->type == C_VIEW) {
|
|
||||||
wlc_view_set_state(view->handle, WLC_BIT_ACTIVATED, true);
|
|
||||||
wlc_view_bring_to_front(view->handle);
|
|
||||||
wlc_view_focus(view->handle);
|
|
||||||
}
|
|
||||||
// Propagete focus up
|
|
||||||
while (view != &root_container) {
|
while (view != &root_container) {
|
||||||
view->parent->focused = view;
|
view->parent->focused = view;
|
||||||
view = view->parent;
|
view = view->parent;
|
||||||
}
|
}
|
||||||
|
while (view && view->type != C_VIEW) {
|
||||||
|
view = view->focused;
|
||||||
|
}
|
||||||
|
if (view) {
|
||||||
|
wlc_view_set_state(view->handle, WLC_BIT_ACTIVATED, true);
|
||||||
|
wlc_view_focus(view->handle);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue