diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-07-23 07:57:48 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-23 07:57:48 -0400 |
commit | 0515b37dfde41cfa85529ac0f8b991a1bec749d2 (patch) | |
tree | 5f855ab05c0ec079f4487e9527f87f37c1929bf1 /sway/tree | |
parent | 89dc047ca9558efe4efe8a81a15903cd0f0bdcba (diff) | |
parent | 12e90fa6006b2cf17a5b5983b5a6e2e70cda58d3 (diff) |
Merge pull request #2323 from RyanDwyer/scratchpad
Implement scratchpad
Diffstat (limited to 'sway/tree')
-rw-r--r-- | sway/tree/container.c | 8 | ||||
-rw-r--r-- | sway/tree/layout.c | 8 | ||||
-rw-r--r-- | sway/tree/view.c | 2 |
3 files changed, 17 insertions, 1 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; diff --git a/sway/tree/layout.c b/sway/tree/layout.c index 533906fa..a2be0ef3 100644 --- a/sway/tree/layout.c +++ b/sway/tree/layout.c @@ -42,6 +42,7 @@ void layout_init(void) { wl_list_init(&root_container.sway_root->xwayland_unmanaged); wl_list_init(&root_container.sway_root->drag_icons); wl_signal_init(&root_container.sway_root->events.new_container); + root_container.sway_root->scratchpad = create_list(); root_container.sway_root->output_layout_change.notify = output_layout_handle_change; @@ -135,6 +136,10 @@ void container_add_child(struct sway_container *parent, list_add(parent->children, child); child->parent = parent; container_handle_fullscreen_reparent(child, old_parent); + if (old_parent) { + container_set_dirty(old_parent); + } + container_set_dirty(child); } struct sway_container *container_remove_child(struct sway_container *child) { @@ -153,6 +158,9 @@ struct sway_container *container_remove_child(struct sway_container *child) { child->parent = NULL; container_notify_subtree_changed(parent); + container_set_dirty(parent); + container_set_dirty(child); + return parent; } diff --git a/sway/tree/view.c b/sway/tree/view.c index 89150a69..9d88d7aa 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c @@ -1065,7 +1065,7 @@ void view_update_marks_textures(struct sway_view *view) { } bool view_is_visible(struct sway_view *view) { - if (!view->swayc || view->swayc->destroying) { + if (!view->swayc || view->swayc->destroying || !view->swayc->parent) { return false; } struct sway_container *workspace = |