diff options
Diffstat (limited to 'sway')
-rw-r--r-- | sway/input/seat.c | 14 | ||||
-rw-r--r-- | sway/tree/output.c | 10 |
2 files changed, 13 insertions, 11 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c index d35cbeef..0e539b70 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c @@ -728,14 +728,14 @@ struct sway_container *seat_get_focus_inactive(struct sway_seat *seat, struct sway_container *seat_get_active_child(struct sway_seat *seat, struct sway_container *container) { - struct sway_container *focus = seat_get_focus_inactive(seat, container); - if (!focus) { - return NULL; - } - while (focus->parent != container) { - focus = focus->parent; + struct sway_seat_container *current = NULL; + wl_list_for_each(current, &seat->focus_stack, link) { + if (current->container->parent == container && + current->container->layout != L_FLOATING) { + return current->container; + } } - return focus; + return NULL; } struct sway_container *seat_get_focus(struct sway_seat *seat) { diff --git a/sway/tree/output.c b/sway/tree/output.c index 6c7044a2..8823eba0 100644 --- a/sway/tree/output.c +++ b/sway/tree/output.c @@ -8,10 +8,6 @@ struct sway_container *output_create( struct sway_output *sway_output) { - struct wlr_box size; - wlr_output_effective_resolution(sway_output->wlr_output, &size.width, - &size.height); - const char *name = sway_output->wlr_output->name; char identifier[128]; output_get_identifier(identifier, sizeof(identifier), sway_output); @@ -54,6 +50,12 @@ struct sway_container *output_create( container_add_child(&root_container, output); load_swaybars(); + struct wlr_box size; + wlr_output_effective_resolution(sway_output->wlr_output, &size.width, + &size.height); + output->width = size.width; + output->height = size.height; + // Create workspace char *ws_name = workspace_next_name(output->name); wlr_log(L_DEBUG, "Creating default workspace %s", ws_name); |