Crop workspaces during transition tightly
Browse files at this commitccce8d3141d34608db4623bcd054af637c5a45ccParent: f3e04981 changed file +6 -7
- src/layout.rs +6 -7
src/layout.rsmodified+6 -7
| @@ -1706,7 +1706,7 @@ impl Monitor<Window> { | ||
| 1706 | 1706 | let output_scale = Scale::from(self.output.current_scale().fractional_scale()); |
| 1707 | 1707 | let output_transform = self.output.current_transform(); |
| 1708 | 1708 | let output_mode = self.output.current_mode().unwrap(); |
| 1709 | - let output_size = output_transform.transform_size(output_mode.size); | |
| 1709 | + let size = output_transform.transform_size(output_mode.size); | |
| 1710 | 1710 | |
| 1711 | 1711 | match &self.workspace_switch { |
| 1712 | 1712 | Some(switch) => { |
| @@ -1714,8 +1714,7 @@ impl Monitor<Window> { | ||
| 1714 | 1714 | let below_idx = render_idx.floor() as usize; |
| 1715 | 1715 | let above_idx = render_idx.ceil() as usize; |
| 1716 | 1716 | |
| 1717 | - let offset = | |
| 1718 | - ((render_idx - below_idx as f64) * output_size.h as f64).round() as i32; | |
| 1717 | + let offset = ((render_idx - below_idx as f64) * size.h as f64).round() as i32; | |
| 1719 | 1718 | |
| 1720 | 1719 | let below = self.workspaces[below_idx].render_elements(renderer); |
| 1721 | 1720 | let above = self.workspaces[above_idx].render_elements(renderer); |
| @@ -1725,7 +1724,7 @@ impl Monitor<Window> { | ||
| 1725 | 1724 | CropRenderElement::from_element( |
| 1726 | 1725 | elem, |
| 1727 | 1726 | output_scale, |
| 1728 | - Rectangle::from_loc_and_size((0, 0), output_size), | |
| 1727 | + Rectangle::from_extemities((0, offset), (size.w, size.h)), | |
| 1729 | 1728 | )?, |
| 1730 | 1729 | (0, -offset), |
| 1731 | 1730 | Relocate::Relative, |
| @@ -1736,9 +1735,9 @@ impl Monitor<Window> { | ||
| 1736 | 1735 | CropRenderElement::from_element( |
| 1737 | 1736 | elem, |
| 1738 | 1737 | output_scale, |
| 1739 | - Rectangle::from_loc_and_size((0, 0), output_size), | |
| 1738 | + Rectangle::from_extemities((0, 0), (size.w, offset)), | |
| 1740 | 1739 | )?, |
| 1741 | - (0, -offset + output_size.h), | |
| 1740 | + (0, -offset + size.h), | |
| 1742 | 1741 | Relocate::Relative, |
| 1743 | 1742 | )) |
| 1744 | 1743 | }); |
| @@ -1753,7 +1752,7 @@ impl Monitor<Window> { | ||
| 1753 | 1752 | CropRenderElement::from_element( |
| 1754 | 1753 | elem, |
| 1755 | 1754 | output_scale, |
| 1756 | - Rectangle::from_loc_and_size((0, 0), output_size), | |
| 1755 | + Rectangle::from_loc_and_size((0, 0), size), | |
| 1757 | 1756 | )?, |
| 1758 | 1757 | (0, 0), |
| 1759 | 1758 | Relocate::Relative, |