summaryrefslogtreecommitdiffstats
path: root/sway/container.c
diff options
context:
space:
mode:
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..666d6a2c 100644
--- a/sway/container.c
+++ b/sway/container.c
@@ -520,16 +520,25 @@ void set_view_visibility(swayc_t *view, void *data) {
520 if (!ASSERT_NONNULL(view)) { 520 if (!ASSERT_NONNULL(view)) {
521 return; 521 return;
522 } 522 }
523 uint32_t *p = data; 523 uint32_t mask = *(uint32_t *)data;
524 if (view->type == C_VIEW) { 524 if (view->type == C_VIEW) {
525 wlc_view_set_mask(view->handle, *p); 525 wlc_view_set_mask(view->handle, mask);
526 if (*p == 2) { 526 if (mask & VISIBLE) {
527 wlc_view_bring_to_front(view->handle); 527 wlc_view_bring_to_front(view->handle);
528 } else { 528 } else {
529 wlc_view_send_to_back(view->handle); 529 wlc_view_send_to_back(view->handle);
530 } 530 }
531 } 531 }
532 view->visible = (*p == 2); 532 view->visible = mask & VISIBLE;
533 sway_log(L_DEBUG, "Container %p is now %s", view, view->visible ? "visible" : "invisible");
534}
535
536void update_visibility(swayc_t *container) {
537 swayc_t *ws = swayc_active_workspace_for(container);
538 bool visible = ws->parent->focused == container;
539 uint32_t mask = visible ? VISIBLE : INVISIBLE;
540 sway_log(L_DEBUG, "Setting visibility of container %p to %s", container, visible ? "visible" : "invisible");
541 container_map(ws, set_view_visibility, &mask);
533} 542}
534 543
535void reset_gaps(swayc_t *view, void *data) { 544void reset_gaps(swayc_t *view, void *data) {