aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2024-02-13 09:15:13 +0400
committerIvan Molodetskikh <yalterz@gmail.com>2024-02-21 21:41:12 +0400
commit340bac0690972ee6f6badc8d386162320d70b7bd (patch)
tree1ec8cabfe0d465fc973a62af8a3304be1dfd471f /src
parentd1b8134337effeb146d5111e477c3ca5ca917d66 (diff)
downloadniri-340bac0690972ee6f6badc8d386162320d70b7bd.tar.gz
niri-340bac0690972ee6f6badc8d386162320d70b7bd.tar.bz2
niri-340bac0690972ee6f6badc8d386162320d70b7bd.zip
Remove unnecessary crop bounds during workspace switch
Diffstat (limited to 'src')
-rw-r--r--src/layout/monitor.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/layout/monitor.rs b/src/layout/monitor.rs
index ff63ed4f..df167b89 100644
--- a/src/layout/monitor.rs
+++ b/src/layout/monitor.rs
@@ -633,12 +633,17 @@ impl<W: LayoutElement> Monitor<W> {
let before = self.workspaces[before_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, otherwise it will cut pixel shaders and mess up the coordinate space.
let before = before.into_iter().filter_map(|elem| {
Some(RelocateRenderElement::from_element(
CropRenderElement::from_element(
elem,
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),
Relocate::Relative,
@@ -649,7 +654,10 @@ impl<W: LayoutElement> Monitor<W> {
CropRenderElement::from_element(
elem,
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),
Relocate::Relative,