deps: bump rustix to version 1

This commit is contained in:
En-En 2025-10-03 20:57:28 +00:00 committed by Supreeeme
parent a9188e70bd
commit e827c42d2d
6 changed files with 122 additions and 93 deletions

View file

@ -119,7 +119,7 @@ pub fn main(mut data: impl RunData) -> Option<()> {
unsafe { Box::from_raw(data as *mut _) }
}
let connection = match poll(&mut ready_fds, -1) {
let connection = match poll(&mut ready_fds, None) {
Ok(_) => {
if !ready_fds[1].revents().is_empty() {
let status = xwayland_exit_code(&mut finish_rx);
@ -156,7 +156,7 @@ pub fn main(mut data: impl RunData) -> Option<()> {
];
loop {
match poll(&mut fds, -1) {
match poll(&mut fds, None) {
Ok(_) => {
if !fds[3].revents().is_empty() {
let status = xwayland_exit_code(&mut quit_rx);
@ -219,7 +219,7 @@ pub fn main(mut data: impl RunData) -> Option<()> {
xstate.update_global_scale(scale);
}
match poll(&mut fds, -1) {
match poll(&mut fds, None) {
Ok(_) => {
if !fds[3].revents().is_empty() {
let status = xwayland_exit_code(&mut quit_rx);

View file

@ -11,7 +11,7 @@ use crate::{X11Selection, XConnection};
use clientside::MyWorld;
use hecs::{Entity, World};
use log::{debug, warn};
use rustix::event::{poll, PollFd, PollFlags};
use rustix::event::{poll, PollFd, PollFlags, Timespec};
use smithay_client_toolkit::activation::ActivationState;
use std::collections::{HashMap, HashSet};
use std::ops::{Deref, DerefMut};
@ -569,7 +569,11 @@ impl<C: XConnection> ServerState<C> {
if let Some(r) = self.queue.prepare_read() {
let fd = r.connection_fd();
let pollfd = PollFd::new(&fd, PollFlags::IN);
if poll(&mut [pollfd], 0).unwrap() > 0 {
let timeout = Some(&Timespec {
tv_sec: 0,
tv_nsec: 0,
});
if poll(&mut [pollfd], timeout).unwrap() > 0 {
let _ = r.read();
}
}

View file

@ -2,7 +2,7 @@ use super::{selection::Clipboard, InnerServerState, NoConnection, ServerState, W
use crate::server::selection::{Primary, SelectionType};
use crate::xstate::{SetState, WinSize, WmName};
use crate::XConnection;
use rustix::event::{poll, PollFd, PollFlags};
use rustix::event::{poll, PollFd, PollFlags, Timespec};
use std::collections::HashMap;
use std::io::Write;
use std::os::fd::{AsRawFd, BorrowedFd};
@ -361,7 +361,11 @@ 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)];
if poll(&mut pollfd, 1000).unwrap() == 0 {
let timeout = Some(&Timespec {
tv_sec: 1,
tv_nsec: 0,
});
if poll(&mut pollfd, timeout).unwrap() == 0 {
panic!("Did not get events for testwl!");
}
testwl.dispatch();
@ -1392,11 +1396,15 @@ 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)];
if poll(&mut pollfd, 100).unwrap() == 0 {
let timeout = Some(&Timespec {
tv_sec: 0,
tv_nsec: 100_000_000,
});
if poll(&mut pollfd, timeout).unwrap() == 0 {
panic!("Did not get events for testwl!");
}
f.testwl.dispatch();
while poll(&mut pollfd, 100).unwrap() > 0 {
while poll(&mut pollfd, timeout).unwrap() > 0 {
f.testwl.dispatch();
}
});
@ -1452,11 +1460,15 @@ 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)];
if poll(&mut pollfd, 100).unwrap() == 0 {
let timeout = Some(&Timespec {
tv_sec: 0,
tv_nsec: 100_000_000,
});
if poll(&mut pollfd, timeout).unwrap() == 0 {
panic!("Did not get events for testwl!");
}
f.testwl.dispatch();
while poll(&mut pollfd, 100).unwrap() > 0 {
while poll(&mut pollfd, timeout).unwrap() > 0 {
f.testwl.dispatch();
}
});