| 570 | } |
| 571 | |
| 572 | void dearrange() |
| 573 | { |
| 574 | /* When we have just 2 views on the workspace, we have 2 copies |
| 575 | * of the unfocused view. When dearranging those copies, they overlap. |
| 576 | * If the view is translucent, this means that the view gets darker than |
| 577 | * it really is. * To circumvent this, we just fade out one of the copies */ |
| 578 | wayfire_toplevel_view fading_view = nullptr; |
| 579 | if (count_different_active_views() == 2) |
| 580 | { |
| 581 | fading_view = get_unfocused_view(); |
| 582 | } |
| 583 | |
| 584 | for (auto& sv : views) |
| 585 | { |
| 586 | sv.attribs.off_x.restart_with_end(0); |
| 587 | sv.attribs.off_y.restart_with_end(0); |
| 588 | sv.attribs.off_z.restart_with_end(0); |
| 589 | |
| 590 | sv.attribs.scale_x.restart_with_end(1.0); |
| 591 | sv.attribs.scale_y.restart_with_end(1.0); |
| 592 | |
| 593 | sv.attribs.rotation.restart_with_end(0); |
| 594 | sv.attribs.alpha.restart_with_end(get_view_normal_alpha(sv.view)); |
| 595 | |
| 596 | if (sv.view == fading_view) |
| 597 | { |
| 598 | sv.attribs.alpha.end = 0.0; |
| 599 | // make sure we don't fade out the other unfocused view instance as |
| 600 | // well |
| 601 | fading_view = nullptr; |
| 602 | } |
| 603 | } |
| 604 | |
| 605 | background_dim.restart_with_end(1); |
| 606 | background_dim_duration.start(); |
| 607 | duration.start(); |
| 608 | active = false; |
| 609 | |
| 610 | /* Potentially restore view[0] if it was maximized */ |
| 611 | if (views.size()) |
| 612 | { |
| 613 | wf::get_core().default_wm->focus_raise_view(views[0].view); |
| 614 | } |
| 615 | } |
| 616 | |
| 617 | std::vector<wayfire_view> get_background_views() const |
| 618 | { |
nothing calls this directly
no test coverage detected