aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
Diffstat (limited to 'sway')
-rw-r--r--sway/container.c12
-rw-r--r--sway/layout.c1
-rw-r--r--sway/workspace.c17
3 files changed, 14 insertions, 16 deletions
diff --git a/sway/container.c b/sway/container.c
index 89958a4f..3cf9e47a 100644
--- a/sway/container.c
+++ b/sway/container.c
@@ -227,3 +227,15 @@ void container_map(swayc_t *container, void (*f)(swayc_t *view, void *data), voi
}
}
+void set_view_visibility(swayc_t *view, void *data) {
+ uint32_t *p = data;
+ if (view->type == C_VIEW) {
+ wlc_view_set_mask(view->handle, *p);
+ if (*p == 2) {
+ wlc_view_bring_to_front(view->handle);
+ } else {
+ wlc_view_send_to_back(view->handle);
+ }
+ }
+ view->visible = (*p == 2);
+}
diff --git a/sway/layout.c b/sway/layout.c
index 963bd8dc..4407742a 100644
--- a/sway/layout.c
+++ b/sway/layout.c
@@ -272,4 +272,3 @@ void focus_view_for(swayc_t *top, swayc_t *view) {
}
}
-
diff --git a/sway/workspace.c b/sway/workspace.c
index 15828658..9bc3215f 100644
--- a/sway/workspace.c
+++ b/sway/workspace.c
@@ -80,19 +80,6 @@ bool workspace_by_name(swayc_t *view, void *data) {
(strcasecmp(view->name, (char *) data) == 0);
}
-void set_mask(swayc_t *view, void *data) {
- uint32_t *p = data;
- if (view->type == C_VIEW) {
- wlc_view_set_mask(view->handle, *p);
- }
- if (*p == 2) {
- wlc_view_bring_to_front(view->handle);
- } else {
- wlc_view_send_to_back(view->handle);
- }
- view->visible = (*p == 2);
-}
-
swayc_t *workspace_find_by_name(const char* name) {
return find_container(&root_container, workspace_by_name, (void *) name);
}
@@ -198,9 +185,9 @@ void workspace_switch(swayc_t *workspace) {
// set all c_views in the old workspace to the invisible mask if the workspace
// is in the same output & c_views in the new workspace to the visible mask
- container_map(focused_workspace, set_mask, &mask);
+ container_map(focused_workspace, set_view_visibility, &mask);
mask = 2;
- container_map(workspace, set_mask, &mask);
+ container_map(workspace, set_view_visibility, &mask);
wlc_output_set_mask(ws_output->handle, 2);
destroy_workspace(focused_workspace);