mirror of
https://github.com/YaLTeR/niri.git
synced 2025-10-06 00:23:14 +02:00
Remove unnecessary crop bounds during workspace switch
This commit is contained in:
@@ -629,12 +629,18 @@ impl<W: LayoutElement> Monitor<W> {
|
|||||||
let before = self.workspaces[before_idx].render_elements(renderer);
|
let before = self.workspaces[before_idx].render_elements(renderer);
|
||||||
let after = self.workspaces[after_idx].render_elements(renderer);
|
let after = self.workspaces[after_idx].render_elements(renderer);
|
||||||
|
|
||||||
|
// HACK: crop to infinite bounds for all sides except the side where the workspaces
|
||||||
|
// join, to decrease the chance of cutting a lower-scale surface in the middle of a
|
||||||
|
// pixel, thereby disabling its nearest-neighbor upscaling.
|
||||||
let before = before.into_iter().filter_map(|elem| {
|
let before = before.into_iter().filter_map(|elem| {
|
||||||
Some(RelocateRenderElement::from_element(
|
Some(RelocateRenderElement::from_element(
|
||||||
CropRenderElement::from_element(
|
CropRenderElement::from_element(
|
||||||
elem,
|
elem,
|
||||||
output_scale,
|
output_scale,
|
||||||
Rectangle::from_extemities((0, offset), (size.w, size.h)),
|
Rectangle::from_extemities(
|
||||||
|
(-i32::MAX / 2, -i32::MAX / 2),
|
||||||
|
(i32::MAX / 2, size.h),
|
||||||
|
),
|
||||||
)?,
|
)?,
|
||||||
(0, -offset),
|
(0, -offset),
|
||||||
Relocate::Relative,
|
Relocate::Relative,
|
||||||
@@ -645,7 +651,10 @@ impl<W: LayoutElement> Monitor<W> {
|
|||||||
CropRenderElement::from_element(
|
CropRenderElement::from_element(
|
||||||
elem,
|
elem,
|
||||||
output_scale,
|
output_scale,
|
||||||
Rectangle::from_extemities((0, 0), (size.w, offset)),
|
Rectangle::from_extemities(
|
||||||
|
(-i32::MAX / 2, 0),
|
||||||
|
(i32::MAX / 2, i32::MAX / 2),
|
||||||
|
),
|
||||||
)?,
|
)?,
|
||||||
(0, -offset + size.h),
|
(0, -offset + size.h),
|
||||||
Relocate::Relative,
|
Relocate::Relative,
|
||||||
|
Reference in New Issue
Block a user