winit-x11: fix debug mode overflow panic in set_timestamp

Fixes #4484
This commit is contained in:
SuchAFuriousDeath
2026-02-24 15:15:49 +01:00
committed by GitHub
parent fa10ca1764
commit f3fb2fe3a6
2 changed files with 2 additions and 3 deletions

View File

@@ -250,9 +250,7 @@ impl XConnection {
// Store the timestamp in the slot if it's greater than the last one.
let mut last_timestamp = self.timestamp.load(Ordering::Relaxed);
loop {
let wrapping_sub = |a: xproto::Timestamp, b: xproto::Timestamp| (a as i32) - (b as i32);
if wrapping_sub(timestamp, last_timestamp) <= 0 {
if (timestamp as i32).wrapping_sub(last_timestamp as i32) <= 0 {
break;
}

View File

@@ -55,3 +55,4 @@ changelog entry.
- On Redox, handle `EINTR` when reading from `event_socket` instead of panicking.
- On Wayland, switch from using the `ahash` hashing algorithm to `foldhash`.
- On macOS, fix borderless game presentation options not sticking after switching spaces.
- On X11, fix debug mode overflow panic in `set_timestamp`.