Skip to content

Commit bc04c6e

Browse files
committed
fix(x11): Fix damage regions outside the pixel buffer
1 parent ab16475 commit bc04c6e

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
- **Breaking:** Removed generic type parameters `D` and `W` from `Buffer<'_>` struct.
77
- **Breaking:** Removed `Deref[Mut]` implementation on `Buffer<'_>`. Use `Buffer::pixels()` instead.
88
- **Breaking:** Removed `DamageOutOfRange` error case. If the damage value is greater than the backend supports, it is instead clamped to an appropriate value.
9-
- Fixed `present_with_damage` with bounds out of range on Windows and Web.
9+
- Fixed `present_with_damage` with bounds out of range on Windows, Web and X11.
1010

1111
# 0.4.7
1212

src/backends/x11.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -482,12 +482,12 @@ impl BufferInterface for BufferImpl<'_> {
482482
self.gc,
483483
surface_width.get(),
484484
surface_height.get(),
485-
src_x,
486-
src_y,
487-
width,
488-
height,
489-
dst_x,
490-
dst_y,
485+
src_x.min(surface_width.get()),
486+
src_y.min(surface_height.get()),
487+
width.min(surface_width.get()),
488+
height.min(surface_height.get()),
489+
dst_x.min(surface_width.get() as i16),
490+
dst_y.min(surface_height.get() as i16),
491491
self.depth,
492492
xproto::ImageFormat::Z_PIXMAP.into(),
493493
false,

0 commit comments

Comments
 (0)