wayland: add u64 type macro
This commit is contained in:
parent
7373509274
commit
d6b3973979
30 changed files with 69 additions and 67 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue