fix: bump xcb-util-cursor to 0.3.5

xcb-util-cursor made another patch release to revert back to Rust 2021
edition, so we bump to that.

Also create a function, `timespec_from_millis` to make creating
`Timespec` for using in `poll` calls a lot more ergonomic.
This commit is contained in:
En-En 2025-10-08 12:27:28 +00:00 committed by Supreeeme
parent e827c42d2d
commit bf745144ac
6 changed files with 41 additions and 59 deletions

View file

@ -1,8 +1,8 @@
use super::{selection::Clipboard, InnerServerState, NoConnection, ServerState, WindowDims};
use crate::server::selection::{Primary, SelectionType};
use crate::xstate::{SetState, WinSize, WmName};
use crate::XConnection;
use rustix::event::{poll, PollFd, PollFlags, Timespec};
use crate::{timespec_from_millis, XConnection};
use rustix::event::{poll, PollFd, PollFlags};
use std::collections::HashMap;
use std::io::Write;
use std::os::fd::{AsRawFd, BorrowedFd};
@ -361,11 +361,8 @@ impl EarlyTestFixture {
// Handle initial globals roundtrip setup requirement
let thread = std::thread::spawn(move || {
let mut pollfd = [PollFd::from_borrowed_fd(testwl.poll_fd(), PollFlags::IN)];
let timeout = Some(&Timespec {
tv_sec: 1,
tv_nsec: 0,
});
if poll(&mut pollfd, timeout).unwrap() == 0 {
let timeout = timespec_from_millis(1000);
if poll(&mut pollfd, Some(&timeout)).unwrap() == 0 {
panic!("Did not get events for testwl!");
}
testwl.dispatch();
@ -1396,15 +1393,12 @@ fn copy_from_wayland<T: SelectionTest>() {
s.spawn(|| {
let pollfd = unsafe { BorrowedFd::borrow_raw(f.testwl.poll_fd().as_raw_fd()) };
let mut pollfd = [PollFd::from_borrowed_fd(pollfd, PollFlags::IN)];
let timeout = Some(&Timespec {
tv_sec: 0,
tv_nsec: 100_000_000,
});
if poll(&mut pollfd, timeout).unwrap() == 0 {
let timeout = timespec_from_millis(100);
if poll(&mut pollfd, Some(&timeout)).unwrap() == 0 {
panic!("Did not get events for testwl!");
}
f.testwl.dispatch();
while poll(&mut pollfd, timeout).unwrap() > 0 {
while poll(&mut pollfd, Some(&timeout)).unwrap() > 0 {
f.testwl.dispatch();
}
});
@ -1460,15 +1454,12 @@ fn selection_x11_then_wayland<T: SelectionTest>() {
s.spawn(|| {
let pollfd = unsafe { BorrowedFd::borrow_raw(f.testwl.poll_fd().as_raw_fd()) };
let mut pollfd = [PollFd::from_borrowed_fd(pollfd, PollFlags::IN)];
let timeout = Some(&Timespec {
tv_sec: 0,
tv_nsec: 100_000_000,
});
if poll(&mut pollfd, timeout).unwrap() == 0 {
let timeout = timespec_from_millis(100);
if poll(&mut pollfd, Some(&timeout)).unwrap() == 0 {
panic!("Did not get events for testwl!");
}
f.testwl.dispatch();
while poll(&mut pollfd, timeout).unwrap() > 0 {
while poll(&mut pollfd, Some(&timeout)).unwrap() > 0 {
f.testwl.dispatch();
}
});