1
0
Fork 0
forked from wry/wry

wayland: add u64 type macro

This commit is contained in:
Julian Orth 2025-06-04 13:24:28 +02:00
parent 7373509274
commit d6b3973979
30 changed files with 69 additions and 67 deletions

View file

@ -48,7 +48,8 @@ impl WpCommitTimerV1RequestHandler for WpCommitTimerV1 {
if req.tv_nsec >= 1_000_000_000 {
return Err(WpCommitTimerV1Error::InvalidNsec);
}
let nsec = (((req.tv_sec_hi as u64) << 32) | (req.tv_sec_lo as u64))
let nsec = req
.tv_sec
.checked_mul(1_000_000_000)
.and_then(|n| n.checked_add(req.tv_nsec as u64));
let Some(nsec) = nsec else {

View file

@ -57,24 +57,20 @@ impl WpLinuxDrmSyncobjSurfaceV1RequestHandler for WpLinuxDrmSyncobjSurfaceV1 {
}
fn set_acquire_point(&self, req: SetAcquirePoint, _slf: &Rc<Self>) -> Result<(), Self::Error> {
let point = point(req.point_hi, req.point_lo);
let point = SyncObjPoint(req.point);
let timeline = self.client.lookup(req.timeline)?;
self.surface.pending.borrow_mut().acquire_point = Some((timeline.sync_obj.clone(), point));
Ok(())
}
fn set_release_point(&self, req: SetReleasePoint, _slf: &Rc<Self>) -> Result<(), Self::Error> {
let point = point(req.point_hi, req.point_lo);
let point = SyncObjPoint(req.point);
let timeline = self.client.lookup(req.timeline)?;
self.surface.pending.borrow_mut().release_point = Some((timeline.sync_obj.clone(), point));
Ok(())
}
}
fn point(hi: u32, lo: u32) -> SyncObjPoint {
SyncObjPoint(((hi as u64) << 32) | (lo as u64))
}
object_base! {
self = WpLinuxDrmSyncobjSurfaceV1;
version = self.version;

View file

@ -26,7 +26,7 @@ impl XwaylandSurfaceV1RequestHandler for XwaylandSurfaceV1 {
if self.x.surface.xwayland_serial.is_some() {
return Err(XwaylandSurfaceV1Error::SerialAlreadySet);
}
let serial = req.serial_lo as u64 | ((req.serial_hi as u64) << 32);
let serial = req.serial;
if self.client.last_xwayland_serial.get() >= serial {
return Err(XwaylandSurfaceV1Error::NonMonotonicSerial);
}