diff options
-rw-r--r-- | sway/container.c | 17 | ||||
-rw-r--r-- | sway/handlers.c | 3 | ||||
-rw-r--r-- | sway/input_state.c | 5 |
3 files changed, 21 insertions, 4 deletions
diff --git a/sway/container.c b/sway/container.c index 3558809a..a3bc9864 100644 --- a/sway/container.c +++ b/sway/container.c | |||
@@ -281,8 +281,21 @@ swayc_t *destroy_output(swayc_t *output) { | |||
281 | if (!ASSERT_NONNULL(output)) { | 281 | if (!ASSERT_NONNULL(output)) { |
282 | return NULL; | 282 | return NULL; |
283 | } | 283 | } |
284 | if (output->children->length == 0) { | 284 | if (output->children->length > 0) { |
285 | // TODO move workspaces to other outputs | 285 | int i, len = root_container.children->length; |
286 | // TODO save workspaces when there are no outputs. | ||
287 | // TODO also check if there will ever be no outputs except for exiting | ||
288 | // program | ||
289 | if (len > 1) { | ||
290 | len = output->children->length; | ||
291 | int p = root_container.children->items[0] == output; | ||
292 | // Move workspace from this output to another output | ||
293 | for (i = 0; i < len; ++i) { | ||
294 | swayc_t *child = output->children->items[i]; | ||
295 | remove_child(child); | ||
296 | add_child(root_container.children->items[p], child); | ||
297 | } | ||
298 | } | ||
286 | } | 299 | } |
287 | sway_log(L_DEBUG, "OUTPUT: Destroying output '%lu'", output->handle); | 300 | sway_log(L_DEBUG, "OUTPUT: Destroying output '%lu'", output->handle); |
288 | free_swayc(output); | 301 | free_swayc(output); |
diff --git a/sway/handlers.c b/sway/handlers.c index 93b124bd..2223a98c 100644 --- a/sway/handlers.c +++ b/sway/handlers.c | |||
@@ -424,8 +424,7 @@ static bool handle_pointer_button(wlc_handle view, uint32_t time, const struct w | |||
424 | } | 424 | } |
425 | 425 | ||
426 | // set pointer mode | 426 | // set pointer mode |
427 | pointer_mode_set(button, | 427 | pointer_mode_set(button, !(modifiers->mods ^ config->floating_mod)); |
428 | (modifiers->mods & config->floating_mod) == config->floating_mod); | ||
429 | 428 | ||
430 | // Return if mode has been set | 429 | // Return if mode has been set |
431 | if (pointer_state.mode) { | 430 | if (pointer_state.mode) { |
diff --git a/sway/input_state.c b/sway/input_state.c index 10425c57..0a7c073d 100644 --- a/sway/input_state.c +++ b/sway/input_state.c | |||
@@ -169,6 +169,11 @@ static void pointer_mode_set_left(void) { | |||
169 | pointer_state.mode = M_DRAGGING | M_FLOATING; | 169 | pointer_state.mode = M_DRAGGING | M_FLOATING; |
170 | } else { | 170 | } else { |
171 | pointer_state.mode = M_DRAGGING | M_TILING; | 171 | pointer_state.mode = M_DRAGGING | M_TILING; |
172 | // unset mode if we cant drag tile | ||
173 | if (initial.ptr->parent->type == C_WORKSPACE && | ||
174 | initial.ptr->parent->children->length == 1) { | ||
175 | pointer_state.mode = 0; | ||
176 | } | ||
172 | } | 177 | } |
173 | } | 178 | } |
174 | 179 | ||