From 4e0a3b9c725b8288ea62a2f1c12d2137a4790061 Mon Sep 17 00:00:00 2001 From: minus Date: Fri, 21 Aug 2015 21:27:37 +0200 Subject: [PATCH 1/7] extracted view_set_floating --- include/layout.h | 2 ++ sway/commands.c | 68 +++++++++++++----------------------------------- sway/layout.c | 52 ++++++++++++++++++++++++++++++++++++ 3 files changed, 72 insertions(+), 50 deletions(-) diff --git a/include/layout.h b/include/layout.h index f8aebe0a9..dfee512ed 100644 --- a/include/layout.h +++ b/include/layout.h @@ -30,4 +30,6 @@ swayc_t *get_swayc_in_direction(swayc_t *container, enum movement_direction dir) void recursive_resize(swayc_t *container, double amount, enum wlc_resize_edge edge); +void view_set_floating(swayc_t *view, bool floating); + #endif diff --git a/sway/commands.c b/sway/commands.c index 5de1fb0ca..27dd9ff48 100644 --- a/sway/commands.c +++ b/sway/commands.c @@ -197,58 +197,26 @@ static bool cmd_floating(struct sway_config *config, int argc, char **argv) { return false; } - if (strcasecmp(argv[0], "toggle") == 0) { - swayc_t *view = get_focused_container(&root_container); - // Prevent running floating commands on things like workspaces - if (view->type != C_VIEW) { - return true; - } - // Change from nonfloating to floating - if (!view->is_floating) { - // Remove view from its current location - destroy_container(remove_child(view)); + swayc_t *view = get_focused_container(&root_container); - // and move it into workspace floating - add_floating(swayc_active_workspace(),view); - view->x = (swayc_active_workspace()->width - view->width)/2; - view->y = (swayc_active_workspace()->height - view->height)/2; - if (view->desired_width != -1) { - view->width = view->desired_width; - } - if (view->desired_height != -1) { - view->height = view->desired_height; - } - arrange_windows(swayc_active_workspace(), -1, -1); - } else { - // Delete the view from the floating list and unset its is_floating flag - // Using length-1 as the index is safe because the view must be the currently - // focused floating output - remove_child(view); - view->is_floating = false; - // Get the properly focused container, and add in the view there - swayc_t *focused = container_under_pointer(); - // If focused is null, it's because the currently focused container is a workspace - if (focused == NULL) { - focused = swayc_active_workspace(); - } - set_focused_container(focused); - - sway_log(L_DEBUG, "Non-floating focused container is %p", focused); - - // Case of focused workspace, just create as child of it - if (focused->type == C_WORKSPACE) { - add_child(focused, view); - } - // Regular case, create as sibling of current container - else { - add_sibling(focused, view); - } - // Refocus on the view once its been put back into the layout - view->width = view->height = 0; - arrange_windows(swayc_active_workspace(), -1, -1); - } - set_focused_container(view); + bool floating; + if (strcasecmp(argv[0], "toggle") != 0) { + floating = !view->is_floating; } + else if (strcasecmp(argv[0], "enable") != 0) { + floating = true; + } + else if (strcasecmp(argv[0], "disable") != 0) { + floating = false; + } + else { + sway_log(L_ERROR, "floating - unknown token '%s', expected one of toggle, enable or disable", argv[0]); + return false; + } + + // Change from non-floating to floating or vice versa + view_set_floating(view, floating); + set_focused_container(view); return true; } diff --git a/sway/layout.c b/sway/layout.c index 7f3adc315..1b78e15ed 100644 --- a/sway/layout.c +++ b/sway/layout.c @@ -8,6 +8,7 @@ #include "container.h" #include "workspace.h" #include "focus.h" +#include "handlers.h" swayc_t root_container; int min_sane_h = 60; @@ -412,3 +413,54 @@ void recursive_resize(swayc_t *container, double amount, enum wlc_resize_edge ed } } } + +void view_set_floating(swayc_t *view, bool floating) { + // Prevent running floating commands on things like workspaces + if (view->type != C_VIEW) { + return; + } + + if (floating) { + // Remove view from its current location + destroy_container(remove_child(view)); + + // and move it into workspace floating + add_floating(swayc_active_workspace(),view); + view->x = (swayc_active_workspace()->width - view->width)/2; + view->y = (swayc_active_workspace()->height - view->height)/2; + if (view->desired_width != -1) { + view->width = view->desired_width; + } + if (view->desired_height != -1) { + view->height = view->desired_height; + } + arrange_windows(swayc_active_workspace(), -1, -1); + } else { + // Delete the view from the floating list and unset its is_floating flag + // Using length-1 as the index is safe because the view must be the currently + // focused floating output + remove_child(view); + view->is_floating = false; + // Get the properly focused container, and add in the view there + swayc_t *focused = container_under_pointer(); + // If focused is null, it's because the currently focused container is a workspace + if (focused == NULL) { + focused = swayc_active_workspace(); + } + set_focused_container(focused); + + sway_log(L_DEBUG, "Non-floating focused container is %p", focused); + + // Case of focused workspace, just create as child of it + if (focused->type == C_WORKSPACE) { + add_child(focused, view); + } + // Regular case, create as sibling of current container + else { + add_sibling(focused, view); + } + // Refocus on the view once its been put back into the layout + view->width = view->height = 0; + arrange_windows(swayc_active_workspace(), -1, -1); + } +} From f4b4c5851adcec64d67fcd925ba27d8285e3c50a Mon Sep 17 00:00:00 2001 From: minus Date: Fri, 21 Aug 2015 22:52:09 +0200 Subject: [PATCH 2/7] added scratchpad (WIP) views that are pushed to the scratchpad still render and accept input. latter only if no other view took focus afterwards --- include/layout.h | 5 +++++ sway/commands.c | 31 ++++++++++++++++++++++++++++--- sway/layout.c | 17 +++++++++++++++++ 3 files changed, 50 insertions(+), 3 deletions(-) diff --git a/include/layout.h b/include/layout.h index dfee512ed..7d18108cb 100644 --- a/include/layout.h +++ b/include/layout.h @@ -32,4 +32,9 @@ void recursive_resize(swayc_t *container, double amount, enum wlc_resize_edge ed void view_set_floating(swayc_t *view, bool floating); +// Scratchpad + +void scratchpad_push(swayc_t *view); +swayc_t *scratchpad_pop(void); + #endif diff --git a/sway/commands.c b/sway/commands.c index 27dd9ff48..39776d89e 100644 --- a/sway/commands.c +++ b/sway/commands.c @@ -200,13 +200,13 @@ static bool cmd_floating(struct sway_config *config, int argc, char **argv) { swayc_t *view = get_focused_container(&root_container); bool floating; - if (strcasecmp(argv[0], "toggle") != 0) { + if (strcasecmp(argv[0], "toggle") == 0) { floating = !view->is_floating; } - else if (strcasecmp(argv[0], "enable") != 0) { + else if (strcasecmp(argv[0], "enable") == 0) { floating = true; } - else if (strcasecmp(argv[0], "disable") != 0) { + else if (strcasecmp(argv[0], "disable") == 0) { floating = false; } else { @@ -326,12 +326,36 @@ static bool cmd_move(struct sway_config *config, int argc, char **argv) { move_container(view,&root_container,MOVE_UP); } else if (strcasecmp(argv[0], "down") == 0) { move_container(view,&root_container,MOVE_DOWN); + } else if (strcasecmp(argv[0], "scratchpad") == 0) { + swayc_t *parent = view->parent; + destroy_container(remove_child(view)); + scratchpad_push(view); + set_focused_container(parent); } else { return false; } return true; } +static bool cmd_scratchpad(struct sway_config *config, int argc, char **argv) { + if (!checkarg(argc, "scratchpad", EXPECTED_EQUAL_TO, 1)) { + return false; + } + + if (strcasecmp(argv[0], "show") != 0) { + sway_log(L_ERROR, "scratchpad - unknown token '%s', expected show", argv[0]); + return false; + } + + swayc_t *view = scratchpad_pop(); + if (view == NULL) { + return false; + } + view_set_floating(view, true); + + return true; +} + static bool cmd_output(struct sway_config *config, int argc, char **argv) { if (!checkarg(argc, "output", EXPECTED_AT_LEAST, 1)) { return false; @@ -668,6 +692,7 @@ static struct cmd_handler handlers[] = { { "output", cmd_output}, { "reload", cmd_reload }, { "resize", cmd_resize }, + { "scratchpad", cmd_scratchpad }, { "set", cmd_set }, { "split", cmd_split }, { "splith", cmd_splith }, diff --git a/sway/layout.c b/sway/layout.c index 1b78e15ed..6b7bdae34 100644 --- a/sway/layout.c +++ b/sway/layout.c @@ -14,11 +14,15 @@ swayc_t root_container; int min_sane_h = 60; int min_sane_w = 100; +static swayc_t *scratchpad = NULL; + void init_layout(void) { root_container.type = C_ROOT; root_container.layout = L_NONE; root_container.children = create_list(); root_container.handle = -1; + + scratchpad = new_workspace(&root_container, "__i3_scratch"); } static int index_child(swayc_t *parent, swayc_t *child) { @@ -464,3 +468,16 @@ void view_set_floating(swayc_t *view, bool floating) { arrange_windows(swayc_active_workspace(), -1, -1); } } + +void scratchpad_push(swayc_t *view) { + add_floating(scratchpad, view); +} + +swayc_t *scratchpad_pop(void) { + if (scratchpad->floating->length == 0) { + return NULL; + } + swayc_t *view = scratchpad->floating->items[0]; + remove_child(view); + return view; +} From 6736a0597756240b18a840fd51501e845d0d70a4 Mon Sep 17 00:00:00 2001 From: minus Date: Fri, 21 Aug 2015 23:36:01 +0200 Subject: [PATCH 3/7] added hiding and showing scratchpad views credits go to taiyu. also prevent moving anything but views to scratchpad --- sway/commands.c | 13 +++++++------ sway/layout.c | 3 +++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/sway/commands.c b/sway/commands.c index 39776d89e..e267084a7 100644 --- a/sway/commands.c +++ b/sway/commands.c @@ -319,18 +319,19 @@ static bool cmd_move(struct sway_config *config, int argc, char **argv) { swayc_t *view = get_focused_container(&root_container); if (strcasecmp(argv[0], "left") == 0) { - move_container(view,&root_container,MOVE_LEFT); + move_container(view, &root_container, MOVE_LEFT); } else if (strcasecmp(argv[0], "right") == 0) { - move_container(view,&root_container,MOVE_RIGHT); + move_container(view, &root_container, MOVE_RIGHT); } else if (strcasecmp(argv[0], "up") == 0) { - move_container(view,&root_container,MOVE_UP); + move_container(view, &root_container, MOVE_UP); } else if (strcasecmp(argv[0], "down") == 0) { - move_container(view,&root_container,MOVE_DOWN); - } else if (strcasecmp(argv[0], "scratchpad") == 0) { + move_container(view, &root_container, MOVE_DOWN); + } else if (strcasecmp(argv[0], "scratchpad") == 0 && view->type == C_VIEW) { swayc_t *parent = view->parent; destroy_container(remove_child(view)); scratchpad_push(view); - set_focused_container(parent); + set_focused_container(get_focused_view(parent)); + arrange_windows(parent, -1, -1); } else { return false; } diff --git a/sway/layout.c b/sway/layout.c index 6b7bdae34..381e72e3d 100644 --- a/sway/layout.c +++ b/sway/layout.c @@ -471,6 +471,8 @@ void view_set_floating(swayc_t *view, bool floating) { void scratchpad_push(swayc_t *view) { add_floating(scratchpad, view); + wlc_view_set_mask(view->handle, 2); // invisible mask + wlc_view_send_to_back(view->handle); } swayc_t *scratchpad_pop(void) { @@ -478,6 +480,7 @@ swayc_t *scratchpad_pop(void) { return NULL; } swayc_t *view = scratchpad->floating->items[0]; + wlc_view_set_mask(view->handle, 1); // visible mask remove_child(view); return view; } From 6a33d67f36450c2faa63b99df79f825a1ff99258 Mon Sep 17 00:00:00 2001 From: minus Date: Fri, 21 Aug 2015 23:47:52 +0200 Subject: [PATCH 4/7] fixed parent finding --- sway/commands.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sway/commands.c b/sway/commands.c index e267084a7..7490c3eb9 100644 --- a/sway/commands.c +++ b/sway/commands.c @@ -327,8 +327,7 @@ static bool cmd_move(struct sway_config *config, int argc, char **argv) { } else if (strcasecmp(argv[0], "down") == 0) { move_container(view, &root_container, MOVE_DOWN); } else if (strcasecmp(argv[0], "scratchpad") == 0 && view->type == C_VIEW) { - swayc_t *parent = view->parent; - destroy_container(remove_child(view)); + swayc_t *parent = destroy_container(remove_child(view)); scratchpad_push(view); set_focused_container(get_focused_view(parent)); arrange_windows(parent, -1, -1); From 6c1e7cdebdd6117b2482ab6466c37f8cc6202eef Mon Sep 17 00:00:00 2001 From: minus Date: Sat, 22 Aug 2015 00:01:15 +0200 Subject: [PATCH 5/7] fixed style --- sway/layout.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sway/layout.c b/sway/layout.c index 381e72e3d..48af3bf53 100644 --- a/sway/layout.c +++ b/sway/layout.c @@ -472,13 +472,14 @@ void view_set_floating(swayc_t *view, bool floating) { void scratchpad_push(swayc_t *view) { add_floating(scratchpad, view); wlc_view_set_mask(view->handle, 2); // invisible mask - wlc_view_send_to_back(view->handle); + wlc_view_send_to_back(view->handle); } swayc_t *scratchpad_pop(void) { if (scratchpad->floating->length == 0) { return NULL; } + swayc_t *view = scratchpad->floating->items[0]; wlc_view_set_mask(view->handle, 1); // visible mask remove_child(view); From 2f7269a3f17f63fddf3888b36f1508a415583acc Mon Sep 17 00:00:00 2001 From: minus Date: Sat, 22 Aug 2015 22:51:45 +0200 Subject: [PATCH 6/7] ignore internal containers when switching workspace --- include/container.h | 3 +++ sway/layout.c | 13 ++++++++++++- sway/workspace.c | 43 +++++++++++++++++++------------------------ 3 files changed, 34 insertions(+), 25 deletions(-) diff --git a/include/container.h b/include/container.h index 2ced248b3..6f1fcdec9 100644 --- a/include/container.h +++ b/include/container.h @@ -30,6 +30,9 @@ enum swayc_layouts{ struct sway_container { wlc_handle handle; + // Internal container, e.g. scratchpad + bool internal; + enum swayc_types type; enum swayc_layouts layout; diff --git a/sway/layout.c b/sway/layout.c index 48af3bf53..5b1fa9743 100644 --- a/sway/layout.c +++ b/sway/layout.c @@ -14,15 +14,26 @@ swayc_t root_container; int min_sane_h = 60; int min_sane_w = 100; +static swayc_t null_output; static swayc_t *scratchpad = NULL; void init_layout(void) { root_container.type = C_ROOT; root_container.layout = L_NONE; + null_output.name = "root"; root_container.children = create_list(); root_container.handle = -1; - scratchpad = new_workspace(&root_container, "__i3_scratch"); + null_output.type = C_OUTPUT; + null_output.layout = L_NONE; + null_output.name = "__i3"; + null_output.children = create_list(); + null_output.handle = -1; + null_output.internal = true; + add_child(&root_container, &null_output); + + scratchpad = new_workspace(&null_output, "__i3_scratch"); + scratchpad->internal = true; } static int index_child(swayc_t *parent, swayc_t *child) { diff --git a/sway/workspace.c b/sway/workspace.c index 80b67128d..a7b9a7eda 100644 --- a/sway/workspace.c +++ b/sway/workspace.c @@ -113,20 +113,17 @@ void workspace_next() { return; } } - if (root_container.children->length > 1) { - for (i = 0; i < root_container.children->length - 1; i++) { - if (root_container.children->items[i] == current_output) { - workspace_switch(((swayc_t *)root_container.children->items[i + 1])->focused); - workspace_output_next(); - return; + + for (i = 0; i < root_container.children->length; i++) { + if (root_container.children->items[i] == current_output) { + swayc_t *next_output = root_container.children->items[(i + 1)%root_container.children->length]; + if (next_output->internal) { + next_output = root_container.children->items[(i + 2)%root_container.children->length]; } + workspace_switch(next_output->focused); + workspace_output_next(); + return; } - // If we're at the last output, then go to the first - workspace_switch(((swayc_t *)root_container.children->items[0])->focused); - workspace_output_next(); - return; - } else { - workspace_switch(current_output->children->items[0]); } } @@ -157,20 +154,18 @@ void workspace_prev() { return; } } - if (root_container.children->length > 1) { - for (i = 1; i < root_container.children->length; i++) { - if (root_container.children->items[i] == current_output) { - workspace_switch(((swayc_t *)root_container.children->items[i - 1])->focused); - workspace_output_next(); - return; + + int num_outputs = root_container.children->length; + for (i = 0; i < num_outputs; i++) { + if (root_container.children->items[i] == current_output) { + swayc_t *next_output = root_container.children->items[(num_outputs + i - 1)%num_outputs]; + if (next_output->internal) { + next_output = root_container.children->items[(num_outputs + i - 2)%num_outputs]; } + workspace_switch(next_output->focused); + workspace_output_next(); + return; } - // If we're at the first output, then go to the last - workspace_switch(((swayc_t *)root_container.children->items[root_container.children->length-1])->focused); - workspace_output_next(); - return; - } else { - workspace_switch(current_output->children->items[current_output->children->length - 1]); } } From 60b3b87edd06c3a9aa793074e4295d549ef054ed Mon Sep 17 00:00:00 2001 From: minus Date: Sun, 23 Aug 2015 00:23:51 +0200 Subject: [PATCH 7/7] added "move container to workspace", changed scratchpad still WIP, latter is not really working --- include/layout.h | 10 ++++------ sway/commands.c | 42 ++++++++++++++++++++++++++++++------------ sway/container.c | 2 ++ sway/layout.c | 39 +++++++++++++++++++-------------------- 4 files changed, 55 insertions(+), 38 deletions(-) diff --git a/include/layout.h b/include/layout.h index 7d18108cb..23aa98e9c 100644 --- a/include/layout.h +++ b/include/layout.h @@ -11,6 +11,8 @@ extern swayc_t root_container; extern int min_sane_w; extern int min_sane_h; +extern swayc_t *scratchpad; + void init_layout(void); void add_child(swayc_t *parent, swayc_t *child); @@ -20,7 +22,8 @@ swayc_t *add_sibling(swayc_t *sibling, swayc_t *child); swayc_t *replace_child(swayc_t *child, swayc_t *new_child); swayc_t *remove_child(swayc_t *child); -void move_container(swayc_t* container,swayc_t* root,enum movement_direction direction); +void move_container_to_direction(swayc_t* container,swayc_t* root,enum movement_direction direction); +void move_container_to(swayc_t* container, swayc_t* destination); // Layout void arrange_windows(swayc_t *container, double width, double height); @@ -32,9 +35,4 @@ void recursive_resize(swayc_t *container, double amount, enum wlc_resize_edge ed void view_set_floating(swayc_t *view, bool floating); -// Scratchpad - -void scratchpad_push(swayc_t *view); -swayc_t *scratchpad_pop(void); - #endif diff --git a/sway/commands.c b/sway/commands.c index 7490c3eb9..f6fdba066 100644 --- a/sway/commands.c +++ b/sway/commands.c @@ -312,25 +312,40 @@ static bool cmd_focus_follows_mouse(struct sway_config *config, int argc, char * } static bool cmd_move(struct sway_config *config, int argc, char **argv) { - if (!checkarg(argc, "workspace", EXPECTED_EQUAL_TO, 1)) { + if (!checkarg(argc, "workspace", EXPECTED_AT_LEAST, 1)) { return false; } swayc_t *view = get_focused_container(&root_container); if (strcasecmp(argv[0], "left") == 0) { - move_container(view, &root_container, MOVE_LEFT); + move_container_to_direction(view, &root_container, MOVE_LEFT); } else if (strcasecmp(argv[0], "right") == 0) { - move_container(view, &root_container, MOVE_RIGHT); + move_container_to_direction(view, &root_container, MOVE_RIGHT); } else if (strcasecmp(argv[0], "up") == 0) { - move_container(view, &root_container, MOVE_UP); + move_container_to_direction(view, &root_container, MOVE_UP); } else if (strcasecmp(argv[0], "down") == 0) { - move_container(view, &root_container, MOVE_DOWN); + move_container_to_direction(view, &root_container, MOVE_DOWN); + } else if (strcasecmp(argv[0], "container") == 0) { + // "move container to workspace x" + if (!checkarg(argc, "move container", EXPECTED_EQUAL_TO, 4) || + strcasecmp(argv[1], "to") != 0 || + strcasecmp(argv[2], "workspace") != 0) { + return false; + } + + if (view->type != C_CONTAINER && view->type != C_VIEW) { + return false; + } + + swayc_t *ws = workspace_by_name(argv[3]); + if (ws == NULL) { + ws = workspace_create(argv[3]); + } + move_container_to(view, ws); } else if (strcasecmp(argv[0], "scratchpad") == 0 && view->type == C_VIEW) { - swayc_t *parent = destroy_container(remove_child(view)); - scratchpad_push(view); - set_focused_container(get_focused_view(parent)); - arrange_windows(parent, -1, -1); + view_set_floating(view, true); + move_container_to(view, scratchpad); } else { return false; } @@ -347,11 +362,14 @@ static bool cmd_scratchpad(struct sway_config *config, int argc, char **argv) { return false; } - swayc_t *view = scratchpad_pop(); - if (view == NULL) { + if (scratchpad->floating->length == 0) { return false; } - view_set_floating(view, true); + + swayc_t *view = scratchpad->floating->items[0]; + sway_log(L_DEBUG, "Popped view %p from scratchpad", view); + remove_child(view); + move_container_to(view, swayc_active_workspace()); return true; } diff --git a/sway/container.c b/sway/container.c index 41d21c3b2..4bd4108c1 100644 --- a/sway/container.c +++ b/sway/container.c @@ -490,8 +490,10 @@ void set_view_visibility(swayc_t *view, void *data) { if (view->type == C_VIEW) { wlc_view_set_mask(view->handle, *p); if (*p == 2) { + sway_log(L_DEBUG, "Showing view %p(%s)", view, view->name); wlc_view_bring_to_front(view->handle); } else { + sway_log(L_DEBUG, "Hiding view %p(%s)", view, view->name); wlc_view_send_to_back(view->handle); } } diff --git a/sway/layout.c b/sway/layout.c index 5b1fa9743..1217866c6 100644 --- a/sway/layout.c +++ b/sway/layout.c @@ -15,7 +15,7 @@ int min_sane_h = 60; int min_sane_w = 100; static swayc_t null_output; -static swayc_t *scratchpad = NULL; +swayc_t *scratchpad = NULL; void init_layout(void) { root_container.type = C_ROOT; @@ -128,7 +128,7 @@ swayc_t *remove_child(swayc_t *child) { //TODO: Implement horizontal movement. //TODO: Implement move to a different workspace. -void move_container(swayc_t *container,swayc_t* root,enum movement_direction direction){ +void move_container_to_direction(swayc_t *container,swayc_t* root,enum movement_direction direction){ sway_log(L_DEBUG, "Moved window"); swayc_t *temp; int i; @@ -164,13 +164,29 @@ void move_container(swayc_t *container,swayc_t* root,enum movement_direction dir break; } else if (child->children != NULL){ - move_container(container,child,direction); + move_container_to_direction(container,child,direction); } } } +void move_container_to(swayc_t* container, swayc_t* destination) { + destroy_container(remove_child(container)); + set_focused_container(get_focused_view(&root_container)); + if (container->is_floating) { + add_floating(destination, container); + } else { + add_child(destination, container); + } + // TODO: don't set it invisible here, it could have been + // moved to another visible workspace, or from the scratchpad + uint32_t mask = 2; + set_view_visibility(container, &mask); + arrange_windows(&root_container, -1, -1); +} + + void arrange_windows(swayc_t *container, double width, double height) { int i; if (width == -1 || height == -1) { @@ -479,20 +495,3 @@ void view_set_floating(swayc_t *view, bool floating) { arrange_windows(swayc_active_workspace(), -1, -1); } } - -void scratchpad_push(swayc_t *view) { - add_floating(scratchpad, view); - wlc_view_set_mask(view->handle, 2); // invisible mask - wlc_view_send_to_back(view->handle); -} - -swayc_t *scratchpad_pop(void) { - if (scratchpad->floating->length == 0) { - return NULL; - } - - swayc_t *view = scratchpad->floating->items[0]; - wlc_view_set_mask(view->handle, 1); // visible mask - remove_child(view); - return view; -}