summaryrefslogtreecommitdiff
path: root/sway/tree/container.c
diff options
context:
space:
mode:
authorRyan Dwyer <[email protected]>2018-07-22 14:10:40 +1000
committerRyan Dwyer <[email protected]>2018-07-23 08:24:32 +1000
commit81e8f31cc6f284b54ab206e14af7ecbc1a9ed1bb (patch)
treeea124a94869d06edb3f98e85ecd649275e86ef91 /sway/tree/container.c
parent89dc047ca9558efe4efe8a81a15903cd0f0bdcba (diff)
Implement scratchpad
Implements the following commands: * move scratchpad * scratchpad show * [criteria] scratchpad show Also fixes these: * Fix memory leak when executing command with criteria (use `list_free(views)` instead of `free(views)`) * Fix crash when running `move to` with no further arguments
Diffstat (limited to 'sway/tree/container.c')
-rw-r--r--sway/tree/container.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index 42c1d024..4f743c40 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -17,6 +17,7 @@
#include "sway/input/seat.h"
#include "sway/ipc-server.h"
#include "sway/output.h"
+#include "sway/scratchpad.h"
#include "sway/server.h"
#include "sway/tree/arrange.h"
#include "sway/tree/layout.h"
@@ -328,6 +329,10 @@ static struct sway_container *container_destroy_noreaping(
con->destroying = true;
container_set_dirty(con);
+ if (con->scratchpad) {
+ scratchpad_remove_container(con);
+ }
+
if (!con->parent) {
return NULL;
}
@@ -955,6 +960,9 @@ void container_set_floating(struct sway_container *container, bool enable) {
container_reap_empty_recursive(workspace);
} else {
// Returning to tiled
+ if (container->scratchpad) {
+ scratchpad_remove_container(container);
+ }
container_remove_child(container);
container_add_child(workspace, container);
container->width = container->parent->width;