diff options
Diffstat (limited to 'sway/input/seat.c')
-rw-r--r-- | sway/input/seat.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c index d35c62a0..caee37a6 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -688,7 +688,8 @@ void seat_set_focus_warp(struct sway_seat *seat, | |||
688 | // If we've focused a floating container, bring it to the front. | 688 | // If we've focused a floating container, bring it to the front. |
689 | // We do this by putting it at the end of the floating list. | 689 | // We do this by putting it at the end of the floating list. |
690 | if (container && container_is_floating(container)) { | 690 | if (container && container_is_floating(container)) { |
691 | list_move_to_end(container->parent->children, container); | 691 | list_move_to_end( |
692 | container->parent->sway_workspace->floating, container); | ||
692 | } | 693 | } |
693 | 694 | ||
694 | // clean up unfocused empty workspace on new output | 695 | // clean up unfocused empty workspace on new output |
@@ -850,7 +851,7 @@ void seat_set_exclusive_client(struct sway_seat *seat, | |||
850 | struct sway_container *seat_get_focus_inactive(struct sway_seat *seat, | 851 | struct sway_container *seat_get_focus_inactive(struct sway_seat *seat, |
851 | struct sway_container *con) { | 852 | struct sway_container *con) { |
852 | if (con->type == C_WORKSPACE && !con->children->length && | 853 | if (con->type == C_WORKSPACE && !con->children->length && |
853 | !con->sway_workspace->floating->children->length) { | 854 | !con->sway_workspace->floating->length) { |
854 | return con; | 855 | return con; |
855 | } | 856 | } |
856 | if (con->type == C_VIEW) { | 857 | if (con->type == C_VIEW) { |
@@ -873,7 +874,7 @@ struct sway_container *seat_get_focus_inactive_tiling(struct sway_seat *seat, | |||
873 | struct sway_seat_container *current; | 874 | struct sway_seat_container *current; |
874 | wl_list_for_each(current, &seat->focus_stack, link) { | 875 | wl_list_for_each(current, &seat->focus_stack, link) { |
875 | struct sway_container *con = current->container; | 876 | struct sway_container *con = current->container; |
876 | if (con->layout != L_FLOATING && !container_is_floating_or_child(con) && | 877 | if (!container_is_floating_or_child(con) && |
877 | container_has_ancestor(current->container, ancestor)) { | 878 | container_has_ancestor(current->container, ancestor)) { |
878 | return con; | 879 | return con; |
879 | } | 880 | } |
@@ -884,13 +885,13 @@ struct sway_container *seat_get_focus_inactive_tiling(struct sway_seat *seat, | |||
884 | struct sway_container *seat_get_focus_inactive_floating(struct sway_seat *seat, | 885 | struct sway_container *seat_get_focus_inactive_floating(struct sway_seat *seat, |
885 | struct sway_container *ancestor) { | 886 | struct sway_container *ancestor) { |
886 | if (ancestor->type == C_WORKSPACE && | 887 | if (ancestor->type == C_WORKSPACE && |
887 | !ancestor->sway_workspace->floating->children->length) { | 888 | !ancestor->sway_workspace->floating->length) { |
888 | return NULL; | 889 | return NULL; |
889 | } | 890 | } |
890 | struct sway_seat_container *current; | 891 | struct sway_seat_container *current; |
891 | wl_list_for_each(current, &seat->focus_stack, link) { | 892 | wl_list_for_each(current, &seat->focus_stack, link) { |
892 | struct sway_container *con = current->container; | 893 | struct sway_container *con = current->container; |
893 | if (con->layout != L_FLOATING && container_is_floating_or_child(con) && | 894 | if (container_is_floating_or_child(con) && |
894 | container_has_ancestor(current->container, ancestor)) { | 895 | container_has_ancestor(current->container, ancestor)) { |
895 | return con; | 896 | return con; |
896 | } | 897 | } |
@@ -898,11 +899,6 @@ struct sway_container *seat_get_focus_inactive_floating(struct sway_seat *seat, | |||
898 | return NULL; | 899 | return NULL; |
899 | } | 900 | } |
900 | 901 | ||
901 | static bool impl_focus_active_child(struct sway_container *con, void *data) { | ||
902 | struct sway_container *parent = data; | ||
903 | return con->parent == parent && con->layout != L_FLOATING; | ||
904 | } | ||
905 | |||
906 | struct sway_container *seat_get_active_child(struct sway_seat *seat, | 902 | struct sway_container *seat_get_active_child(struct sway_seat *seat, |
907 | struct sway_container *parent) { | 903 | struct sway_container *parent) { |
908 | if (parent->type == C_VIEW) { | 904 | if (parent->type == C_VIEW) { |
@@ -911,7 +907,7 @@ struct sway_container *seat_get_active_child(struct sway_seat *seat, | |||
911 | struct sway_seat_container *current; | 907 | struct sway_seat_container *current; |
912 | wl_list_for_each(current, &seat->focus_stack, link) { | 908 | wl_list_for_each(current, &seat->focus_stack, link) { |
913 | struct sway_container *con = current->container; | 909 | struct sway_container *con = current->container; |
914 | if (con->parent == parent && con->layout != L_FLOATING) { | 910 | if (con->parent == parent) { |
915 | return con; | 911 | return con; |
916 | } | 912 | } |
917 | } | 913 | } |