aboutsummaryrefslogtreecommitdiff
path: root/sway/container.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2015-08-25 16:12:37 -0400
committerDrew DeVault <sir@cmpwn.com>2015-08-25 16:12:37 -0400
commitfa6292ff24082f90886353844b45e99ec965daa5 (patch)
tree06f9219532f6f057410910dbfe43d3884acd90bc /sway/container.c
parent2e755cf13fb653a397a8895121184322dc1dcdd6 (diff)
parent95353051379126f99d310936a46052b4a89bd880 (diff)
Merge pull request #129 from minus7/workspaces
Implemented "move container to workspace"
Diffstat (limited to 'sway/container.c')
-rw-r--r--sway/container.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/sway/container.c b/sway/container.c
index d23cef8f..6fbfa360 100644
--- a/sway/container.c
+++ b/sway/container.c
@@ -520,16 +520,25 @@ void set_view_visibility(swayc_t *view, void *data) {
if (!ASSERT_NONNULL(view)) {
return;
}
- uint32_t *p = data;
+ bool visible = *(bool *)data;
if (view->type == C_VIEW) {
- wlc_view_set_mask(view->handle, *p);
- if (*p == 2) {
+ wlc_view_set_output(view->handle, swayc_parent_by_type(view, C_OUTPUT)->handle);
+ wlc_view_set_mask(view->handle, visible ? VISIBLE : 0);
+ if (visible) {
wlc_view_bring_to_front(view->handle);
} else {
wlc_view_send_to_back(view->handle);
}
}
- view->visible = (*p == 2);
+ view->visible = visible;
+ sway_log(L_DEBUG, "Container %p is now %s", view, visible ? "visible" : "invisible");
+}
+
+void update_visibility(swayc_t *container) {
+ swayc_t *ws = swayc_active_workspace_for(container);
+ bool visible = (ws->parent->focused == ws);
+ sway_log(L_DEBUG, "Setting visibility of container %p to %s", container, visible ? "visible" : "invisible");
+ container_map(ws, set_view_visibility, &visible);
}
void reset_gaps(swayc_t *view, void *data) {