Commit 7e9270240c46
tarball1 file changed+8-3
@@ -17,6 +17,7 @@ use smithay::wayland::dmabuf::{
1717
};1818
use smithay::wayland::drm_syncobj::{DrmSyncobjCachedState, DrmSyncobjHandler, DrmSyncobjState};1919
use smithay::wayland::shm::{ShmHandler, ShmState, with_buffer_contents};20
+use smithay::wayland::viewporter::ViewportCachedState;2021
2122
impl CompositorHandler for State {2223
fn compositor_state(&mut self) -> &mut CompositorState {@@ -199,8 +200,8 @@ fn hold_until_readable(state: &mut State, surface: &WlSurface) {
199200
200201
/// Copies a committed shm buffer's damage on the worker, holding the commit201202
/// until it is staged. Surface damage equals buffer damage at scale 1 with no202
-/// transform, otherwise the whole buffer is staged so it covers whatever the203
-/// import uploads.203
+/// transform and no viewport, otherwise the whole buffer is staged so it covers204
+/// whatever the import uploads.204205
fn stage_shm(state: &mut State, surface: &WlSurface) {205206
let job = with_states(surface, |s| {206207
let mut cached = s.cached_state.get::<SurfaceAttributes>();@@ -211,7 +212,11 @@ fn stage_shm(state: &mut State, surface: &WlSurface) {
211212
if get_dmabuf(buffer).is_ok() {212213
return None;213214
}214
- let plain = attrs.buffer_scale == 1 && attrs.buffer_transform == Transform::Normal.into();215
+ let mut viewport = s.cached_state.get::<ViewportCachedState>();216
+ let viewported = viewport.pending().src.is_some() || viewport.pending().dst.is_some();217
+ let plain = attrs.buffer_scale == 1218
+ && attrs.buffer_transform == Transform::Normal.into()219
+ && !viewported;215220
let region = attrs216221
.damage217222
.iter()