aboutsummaryrefslogtreecommitdiffstats
path: root/sway/container.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/container.c')
-rw-r--r--sway/container.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/sway/container.c b/sway/container.c
index 666d6a2c..acce050f 100644
--- a/sway/container.c
+++ b/sway/container.c
@@ -520,25 +520,24 @@ 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 mask = *(uint32_t *)data; 523 bool visible = *(bool *)data;
524 if (view->type == C_VIEW) { 524 if (view->type == C_VIEW) {
525 wlc_view_set_mask(view->handle, mask); 525 wlc_view_set_mask(view->handle, visible ? VISIBLE : 0);
526 if (mask & VISIBLE) { 526 if (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 = mask & VISIBLE; 532 view->visible = visible;
533 sway_log(L_DEBUG, "Container %p is now %s", view, view->visible ? "visible" : "invisible"); 533 sway_log(L_DEBUG, "Container %p is now %s", view, visible ? "visible" : "invisible");
534} 534}
535 535
536void update_visibility(swayc_t *container) { 536void update_visibility(swayc_t *container) {
537 swayc_t *ws = swayc_active_workspace_for(container); 537 swayc_t *ws = swayc_active_workspace_for(container);
538 bool visible = ws->parent->focused == 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"); 539 sway_log(L_DEBUG, "Setting visibility of container %p to %s", container, visible ? "visible" : "invisible");
541 container_map(ws, set_view_visibility, &mask); 540 container_map(ws, set_view_visibility, &visible);
542} 541}
543 542
544void reset_gaps(swayc_t *view, void *data) { 543void reset_gaps(swayc_t *view, void *data) {