summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sway/input/seat.c14
-rw-r--r--sway/tree/output.c10
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,
728 728
729struct sway_container *seat_get_active_child(struct sway_seat *seat, 729struct sway_container *seat_get_active_child(struct sway_seat *seat,
730 struct sway_container *container) { 730 struct sway_container *container) {
731 struct sway_container *focus = seat_get_focus_inactive(seat, container); 731 struct sway_seat_container *current = NULL;
732 if (!focus) { 732 wl_list_for_each(current, &seat->focus_stack, link) {
733 return NULL; 733 if (current->container->parent == container &&
734 } 734 current->container->layout != L_FLOATING) {
735 while (focus->parent != container) { 735 return current->container;
736 focus = focus->parent; 736 }
737 } 737 }
738 return focus; 738 return NULL;
739} 739}
740 740
741struct sway_container *seat_get_focus(struct sway_seat *seat) { 741struct 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 @@
8 8
9struct sway_container *output_create( 9struct sway_container *output_create(
10 struct sway_output *sway_output) { 10 struct sway_output *sway_output) {
11 struct wlr_box size;
12 wlr_output_effective_resolution(sway_output->wlr_output, &size.width,
13 &size.height);
14
15 const char *name = sway_output->wlr_output->name; 11 const char *name = sway_output->wlr_output->name;
16 char identifier[128]; 12 char identifier[128];
17 output_get_identifier(identifier, sizeof(identifier), sway_output); 13 output_get_identifier(identifier, sizeof(identifier), sway_output);
@@ -54,6 +50,12 @@ struct sway_container *output_create(
54 container_add_child(&root_container, output); 50 container_add_child(&root_container, output);
55 load_swaybars(); 51 load_swaybars();
56 52
53 struct wlr_box size;
54 wlr_output_effective_resolution(sway_output->wlr_output, &size.width,
55 &size.height);
56 output->width = size.width;
57 output->height = size.height;
58
57 // Create workspace 59 // Create workspace
58 char *ws_name = workspace_next_name(output->name); 60 char *ws_name = workspace_next_name(output->name);
59 wlr_log(L_DEBUG, "Creating default workspace %s", ws_name); 61 wlr_log(L_DEBUG, "Creating default workspace %s", ws_name);