Skip to content

Commit

Permalink
deps: Update smithay
Browse files Browse the repository at this point in the history
  • Loading branch information
Drakulix committed Nov 25, 2024
1 parent 1a81c76 commit 8db6f49
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,4 @@ inherits = "release"
lto = "fat"

[patch."https://github.com/Smithay/smithay.git"]
smithay = { git = "https://github.com/smithay//smithay", rev = "ace2e6a" }
smithay = { git = "https://github.com/smithay//smithay", rev = "bc1d732" }
28 changes: 19 additions & 9 deletions src/backend/kms/surface/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ use smithay::{
utils::{Buffer as BufferCoords, Clock, Monotonic, Physical, Rectangle, Size, Transform},
wayland::{
dmabuf::{get_dmabuf, DmabufFeedbackBuilder},
presentation::Refresh,
seat::WaylandFocus,
shm::{shm_format_to_fourcc, with_buffer_contents},
},
Expand Down Expand Up @@ -757,15 +758,24 @@ impl SurfaceThreadState {
)
};

feedback.presented(
clock,
self.output
.current_mode()
.map(|mode| Duration::from_secs_f64(1_000.0 / mode.refresh as f64))
.unwrap_or_default(),
sequence as u64,
flags,
);
let rate = self
.output
.current_mode()
.map(|mode| Duration::from_secs_f64(1_000.0 / mode.refresh as f64));
let refresh = match rate {
Some(rate)
if self
.compositor
.as_ref()
.is_some_and(|comp| comp.vrr_enabled()) =>
{
Refresh::Variable(rate)
}
Some(rate) => Refresh::Fixed(rate),
None => Refresh::Unknown,
};

feedback.presented(clock, refresh, sequence as u64, flags);

self.timings.presented(clock);

Expand Down
10 changes: 7 additions & 3 deletions src/backend/winit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use smithay::{
winit::platform::pump_events::PumpStatus,
},
utils::Transform,
wayland::dmabuf::DmabufFeedbackBuilder,
wayland::{dmabuf::DmabufFeedbackBuilder, presentation::Refresh},
};
use std::{borrow::BorrowMut, cell::RefCell, time::Duration};
use tracing::{error, info, warn};
Expand Down Expand Up @@ -84,8 +84,12 @@ impl WinitState {
state.clock.now(),
self.output
.current_mode()
.map(|mode| Duration::from_secs_f64(1_000.0 / mode.refresh as f64))
.unwrap_or_default(),
.map(|mode| {
Refresh::Fixed(Duration::from_secs_f64(
1_000.0 / mode.refresh as f64,
))
})
.unwrap_or(Refresh::Unknown),
0,
wp_presentation_feedback::Kind::Vsync,
);
Expand Down
10 changes: 7 additions & 3 deletions src/backend/x11.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ use smithay::{
wayland_server::DisplayHandle,
},
utils::{DeviceFd, Transform},
wayland::dmabuf::DmabufFeedbackBuilder,
wayland::{dmabuf::DmabufFeedbackBuilder, presentation::Refresh},
};
use std::{borrow::BorrowMut, cell::RefCell, os::unix::io::OwnedFd, time::Duration};
use tracing::{debug, error, info, warn};
Expand Down Expand Up @@ -234,8 +234,12 @@ impl Surface {
state.clock.now(),
self.output
.current_mode()
.map(|mode| Duration::from_secs_f64(1_000.0 / mode.refresh as f64))
.unwrap_or_default(),
.map(|mode| {
Refresh::Fixed(Duration::from_secs_f64(
1_000.0 / mode.refresh as f64,
))
})
.unwrap_or(Refresh::Unknown),
0,
wp_presentation_feedback::Kind::Vsync,
)
Expand Down
3 changes: 2 additions & 1 deletion src/wayland/handlers/data_device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ impl ClientDndGrabHandler for State {
.lock()
.unwrap() = icon.map(|surface| DnDIcon { surface, offset })
}
fn dropped(&mut self, seat: Seat<Self>) {

fn dropped(&mut self, _target: Option<WlSurface>, _validated: bool, seat: Seat<Self>) {
seat.user_data()
.get::<Mutex<Option<DnDIcon>>>()
.unwrap()
Expand Down

0 comments on commit 8db6f49

Please sign in to comment.