aboutsummaryrefslogtreecommitdiff
path: root/sway/tree
diff options
context:
space:
mode:
authorRyan Dwyer <ryandwyer1@gmail.com>2018-09-05 17:59:31 +1000
committerRyan Dwyer <ryandwyer1@gmail.com>2018-09-05 18:01:43 +1000
commitdbf4aa3e33bdee53876c6893b15ac3f224818e7c (patch)
treeba4ded7f1c63a9ec620122482cadcf0ad68661fa /sway/tree
parent1f2e0ff54b88273ecdbed866c8191b5671f0b7a0 (diff)
Allow marked containers to be moved out of the scratchpad via move command
Diffstat (limited to 'sway/tree')
-rw-r--r--sway/tree/container.c10
-rw-r--r--sway/tree/view.c4
2 files changed, 10 insertions, 4 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index fbce8158..c91b0361 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -1116,9 +1116,11 @@ void container_detach(struct sway_container *child) {
struct sway_container *old_parent = child->parent;
struct sway_workspace *old_workspace = child->workspace;
list_t *siblings = container_get_siblings(child);
- int index = list_find(siblings, child);
- if (index != -1) {
- list_del(siblings, index);
+ if (siblings) {
+ int index = list_find(siblings, child);
+ if (index != -1) {
+ list_del(siblings, index);
+ }
}
child->parent = NULL;
child->workspace = NULL;
@@ -1127,7 +1129,7 @@ void container_detach(struct sway_container *child) {
if (old_parent) {
container_update_representation(old_parent);
node_set_dirty(&old_parent->node);
- } else {
+ } else if (old_workspace) {
workspace_update_representation(old_workspace);
node_set_dirty(&old_workspace->node);
}
diff --git a/sway/tree/view.c b/sway/tree/view.c
index e2d74735..f63a35b5 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -164,6 +164,10 @@ uint32_t view_configure(struct sway_view *view, double lx, double ly, int width,
}
void view_autoconfigure(struct sway_view *view) {
+ if (!view->container->workspace) {
+ // Hidden in the scratchpad
+ return;
+ }
struct sway_output *output = view->container->workspace->output;
if (view->container->is_fullscreen) {