diff --git a/algorithms/src/windows.rs b/algorithms/src/windows.rs index 8332ec66..f71fe807 100644 --- a/algorithms/src/windows.rs +++ b/algorithms/src/windows.rs @@ -8,7 +8,10 @@ pub trait WindowsExt { } impl WindowsExt for [T] { - type Windows<'a, const N: usize> = WindowsIter<'a, T, N> where T: 'a; + type Windows<'a, const N: usize> + = WindowsIter<'a, T, N> + where + T: 'a; fn array_windows_ext<'a, const N: usize>(&'a self) -> Self::Windows<'a, N> { WindowsIter { slice: self } diff --git a/src/ifs/jay_screencast.rs b/src/ifs/jay_screencast.rs index d63a71bb..85e8f820 100644 --- a/src/ifs/jay_screencast.rs +++ b/src/ifs/jay_screencast.rs @@ -333,12 +333,14 @@ impl JayScreencast { &buffer.fb, AcquireSync::Implicit, ReleaseSync::Implicit, + Transform::None, on.global.pos.get(), render_hardware_cursors, x_off, y_off, size, on.global.persistent.transform.get(), + on.global.persistent.scale.get(), ); match res { Ok(_) => { diff --git a/src/state.rs b/src/state.rs index 83f7fff7..45c30708 100644 --- a/src/state.rs +++ b/src/state.rs @@ -937,20 +937,22 @@ impl State { target: &Rc, target_acquire_sync: AcquireSync, target_release_sync: ReleaseSync, + target_transform: Transform, position: Rect, render_hardware_cursors: bool, x_off: i32, y_off: i32, size: Option<(i32, i32)>, transform: Transform, + scale: Scale, ) -> Result, GfxError> { let mut ops = vec![]; let mut renderer = Renderer { - base: target.renderer_base(&mut ops, Scale::from_int(1), Transform::None), + base: target.renderer_base(&mut ops, scale, target_transform), state: self, logical_extents: position.at_point(0, 0), pixel_extents: { - let (width, height) = target.logical_size(Transform::None); + let (width, height) = target.logical_size(target_transform); Rect::new_sized(0, 0, width, height).unwrap() }, }; @@ -963,7 +965,7 @@ impl State { y_off, Some(sample_rect), size, - Scale::from_int(1), + scale, None, resv.cloned(), acquire_sync.clone(), @@ -1013,14 +1015,14 @@ impl State { stride: i32, format: &'static Format, transform: Transform, + scale: Scale, ) -> Result<(), ShmScreencopyError> { let (src_width, src_height) = src.size(); let mut needs_copy = capture.rect.x1() < x_off || capture.rect.x2() > x_off + src_width || capture.rect.y1() < y_off || capture.rect.y2() > y_off + src_height - || self.have_hardware_cursor() - || transform != Transform::None; + || self.have_hardware_cursor(); if let Some((target_width, target_height)) = size { if (target_width, target_height) != (src_width, src_height) { needs_copy = true; @@ -1041,12 +1043,14 @@ impl State { &fb, AcquireSync::Unnecessary, ReleaseSync::None, + transform, position, true, x_off - capture.rect.x1(), y_off - capture.rect.y1(), size, transform, + scale, ) .map_err(ShmScreencopyError::CopyToTemporary)?; mem.access(|mem| { diff --git a/src/tree/output.rs b/src/tree/output.rs index 7f764883..93b43aef 100644 --- a/src/tree/output.rs +++ b/src/tree/output.rs @@ -266,7 +266,8 @@ impl OutputNode { mem, *stride, wl_buffer.format, - Transform::None, + self.global.persistent.transform.get(), + self.global.persistent.scale.get(), ); if let Err(e) = res { log::warn!("Could not perform shm screencopy: {}", ErrorFmt(e)); @@ -291,12 +292,14 @@ impl OutputNode { &fb, AcquireSync::Implicit, ReleaseSync::Implicit, + self.global.persistent.transform.get(), self.global.pos.get(), render_hardware_cursors, x_off - capture.rect.x1(), y_off - capture.rect.y1(), size, - Transform::None, + self.global.persistent.transform.get(), + self.global.persistent.scale.get(), ); if let Err(e) = res { log::warn!("Could not perform screencopy: {}", ErrorFmt(e)); diff --git a/src/utils/windows.rs b/src/utils/windows.rs index 8f225cfb..123a6dcd 100644 --- a/src/utils/windows.rs +++ b/src/utils/windows.rs @@ -12,7 +12,10 @@ pub trait WindowsExt { } impl WindowsExt for [T] { - type Windows<'a, const N: usize> = WindowsIter<'a, T, N> where T: 'a; + type Windows<'a, const N: usize> + = WindowsIter<'a, T, N> + where + T: 'a; fn array_windows_ext<'a, const N: usize>(&'a self) -> Self::Windows<'a, N> { WindowsIter { slice: self }