diff options
author | 2015-08-25 16:12:37 -0400 | |
---|---|---|
committer | 2015-08-25 16:12:37 -0400 | |
commit | fa6292ff24082f90886353844b45e99ec965daa5 (patch) | |
tree | 06f9219532f6f057410910dbfe43d3884acd90bc /sway/container.c | |
parent | Merge pull request #125 from Luminarys/master (diff) | |
parent | fixed moving to other output and visibility (diff) | |
download | sway-fa6292ff24082f90886353844b45e99ec965daa5.tar.gz sway-fa6292ff24082f90886353844b45e99ec965daa5.tar.zst sway-fa6292ff24082f90886353844b45e99ec965daa5.zip |
Merge pull request #129 from minus7/workspaces
Implemented "move container to workspace"
Diffstat (limited to 'sway/container.c')
-rw-r--r-- | sway/container.c | 17 |
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) { | |||
520 | if (!ASSERT_NONNULL(view)) { | 520 | if (!ASSERT_NONNULL(view)) { |
521 | return; | 521 | return; |
522 | } | 522 | } |
523 | uint32_t *p = 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, *p); | 525 | wlc_view_set_output(view->handle, swayc_parent_by_type(view, C_OUTPUT)->handle); |
526 | if (*p == 2) { | 526 | wlc_view_set_mask(view->handle, visible ? VISIBLE : 0); |
527 | if (visible) { | ||
527 | wlc_view_bring_to_front(view->handle); | 528 | wlc_view_bring_to_front(view->handle); |
528 | } else { | 529 | } else { |
529 | wlc_view_send_to_back(view->handle); | 530 | wlc_view_send_to_back(view->handle); |
530 | } | 531 | } |
531 | } | 532 | } |
532 | view->visible = (*p == 2); | 533 | view->visible = visible; |
534 | sway_log(L_DEBUG, "Container %p is now %s", view, visible ? "visible" : "invisible"); | ||
535 | } | ||
536 | |||
537 | void update_visibility(swayc_t *container) { | ||
538 | swayc_t *ws = swayc_active_workspace_for(container); | ||
539 | bool visible = (ws->parent->focused == ws); | ||
540 | sway_log(L_DEBUG, "Setting visibility of container %p to %s", container, visible ? "visible" : "invisible"); | ||
541 | container_map(ws, set_view_visibility, &visible); | ||
533 | } | 542 | } |
534 | 543 | ||
535 | void reset_gaps(swayc_t *view, void *data) { | 544 | void reset_gaps(swayc_t *view, void *data) { |