diff options
Diffstat (limited to 'sway/tree/container.c')
-rw-r--r-- | sway/tree/container.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c index 0a69f8d5..df064573 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c | |||
@@ -835,8 +835,14 @@ void container_end_mouse_operation(struct sway_container *container) { | |||
835 | struct sway_seat *seat; | 835 | struct sway_seat *seat; |
836 | wl_list_for_each(seat, &input_manager->seats, link) { | 836 | wl_list_for_each(seat, &input_manager->seats, link) { |
837 | if (seat->op_container == container) { | 837 | if (seat->op_container == container) { |
838 | seat->op_target_node = NULL; // ensure tiling move doesn't apply | ||
838 | seat_end_mouse_operation(seat); | 839 | seat_end_mouse_operation(seat); |
839 | } | 840 | } |
841 | // If the user is doing a tiling drag over this container, | ||
842 | // keep the operation active but unset the target container. | ||
843 | if (seat->op_target_node == &container->node) { | ||
844 | seat->op_target_node = NULL; | ||
845 | } | ||
840 | } | 846 | } |
841 | } | 847 | } |
842 | 848 | ||
@@ -1057,7 +1063,8 @@ list_t *container_get_current_siblings(struct sway_container *container) { | |||
1057 | } | 1063 | } |
1058 | 1064 | ||
1059 | void container_handle_fullscreen_reparent(struct sway_container *con) { | 1065 | void container_handle_fullscreen_reparent(struct sway_container *con) { |
1060 | if (!con->is_fullscreen || con->workspace->fullscreen == con) { | 1066 | if (!con->is_fullscreen || !con->workspace || |
1067 | con->workspace->fullscreen == con) { | ||
1061 | return; | 1068 | return; |
1062 | } | 1069 | } |
1063 | if (con->workspace->fullscreen) { | 1070 | if (con->workspace->fullscreen) { |
@@ -1086,13 +1093,13 @@ void container_insert_child(struct sway_container *parent, | |||
1086 | } | 1093 | } |
1087 | 1094 | ||
1088 | void container_add_sibling(struct sway_container *fixed, | 1095 | void container_add_sibling(struct sway_container *fixed, |
1089 | struct sway_container *active) { | 1096 | struct sway_container *active, bool after) { |
1090 | if (active->workspace) { | 1097 | if (active->workspace) { |
1091 | container_detach(active); | 1098 | container_detach(active); |
1092 | } | 1099 | } |
1093 | list_t *siblings = container_get_siblings(fixed); | 1100 | list_t *siblings = container_get_siblings(fixed); |
1094 | int index = list_find(siblings, fixed); | 1101 | int index = list_find(siblings, fixed); |
1095 | list_insert(siblings, index + 1, active); | 1102 | list_insert(siblings, index + after, active); |
1096 | active->parent = fixed->parent; | 1103 | active->parent = fixed->parent; |
1097 | active->workspace = fixed->workspace; | 1104 | active->workspace = fixed->workspace; |
1098 | container_for_each_child(active, set_workspace, NULL); | 1105 | container_for_each_child(active, set_workspace, NULL); |
@@ -1145,7 +1152,7 @@ void container_detach(struct sway_container *child) { | |||
1145 | 1152 | ||
1146 | void container_replace(struct sway_container *container, | 1153 | void container_replace(struct sway_container *container, |
1147 | struct sway_container *replacement) { | 1154 | struct sway_container *replacement) { |
1148 | container_add_sibling(container, replacement); | 1155 | container_add_sibling(container, replacement, 1); |
1149 | container_detach(container); | 1156 | container_detach(container); |
1150 | } | 1157 | } |
1151 | 1158 | ||