Skip to content

Commit ee98504

Browse files
authored
Merge pull request #192 from rust-windowing/0.3-backports
0.3 backports
2 parents 52d7048 + 5c7daf1 commit ee98504

File tree

5 files changed

+15
-8
lines changed

5 files changed

+15
-8
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# 0.3.4
2+
* Fix buffer age on Wayland. (#191)
3+
* Update `drm` to 0.11. (#178)
4+
* Fixes build on architectures where drm-rs did not have generated bindings.
5+
16
# 0.3.3
27
* Fix bad file descriptor crash on X11. (#168)
38

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "softbuffer"
3-
version = "0.3.3"
3+
version = "0.3.4"
44
edition = "2021"
55
license = "MIT OR Apache-2.0"
66
description = "Cross-platform software buffer"
@@ -31,7 +31,7 @@ raw-window-handle = "0.5.0"
3131
[target.'cfg(all(unix, not(any(target_vendor = "apple", target_os = "android", target_os = "redox"))))'.dependencies]
3232
as-raw-xcb-connection = { version = "1.0.0", optional = true }
3333
bytemuck = { version = "1.12.3", optional = true }
34-
drm = { version = "0.10.0", default-features = false, optional = true }
34+
drm = { version = "0.11.0", default-features = false, optional = true }
3535
fastrand = { version = "2.0.0", optional = true }
3636
memmap2 = { version = "0.9.0", optional = true }
3737
rustix = { version = "0.38.19", features = ["fs", "mm", "shm", "std"], default-features = false, optional = true }

src/kms.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,7 @@ impl BufferImpl<'_> {
333333
// returns `ENOSYS` and check that before allocating the above and running this.
334334
match self.display.dirty_framebuffer(self.front_fb, &rectangles) {
335335
Ok(()) => {}
336-
Err(drm::SystemError::Unknown { errno })
337-
if errno as i32 == rustix::io::Errno::NOSYS.raw_os_error() => {}
336+
Err(e) if e.raw_os_error() == Some(rustix::io::Errno::NOSYS.raw_os_error()) => {}
338337
Err(e) => {
339338
return Err(SoftBufferError::PlatformError(
340339
Some("failed to dirty framebuffer".into()),

src/wayland/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,14 @@ impl WaylandImpl {
147147
.dispatch_pending(&mut State);
148148

149149
if let Some((front, back)) = &mut self.buffers {
150+
// Swap front and back buffer
151+
std::mem::swap(front, back);
152+
150153
front.age = 1;
151154
if back.age != 0 {
152155
back.age += 1;
153156
}
154157

155-
// Swap front and back buffer
156-
std::mem::swap(front, back);
157-
158158
front.attach(&self.surface);
159159

160160
// Like Mesa's EGL/WSI implementation, we damage the whole buffer with `i32::MAX` if

src/x11.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
use crate::error::SwResultExt;
99
use crate::{Rect, SoftBufferError};
1010
use raw_window_handle::{XcbDisplayHandle, XcbWindowHandle, XlibDisplayHandle, XlibWindowHandle};
11-
use rustix::{fd::{AsFd, BorrowedFd, OwnedFd}, mm, shm as posix_shm};
11+
use rustix::{
12+
fd::{AsFd, BorrowedFd, OwnedFd},
13+
mm, shm as posix_shm,
14+
};
1215

1316
use std::{
1417
fmt,

0 commit comments

Comments
 (0)