From 968956c4954724577fccbf9fb016f4371e30a3e7 Mon Sep 17 00:00:00 2001 From: John Nunley Date: Sat, 2 Mar 2024 14:10:14 -0800 Subject: [PATCH] bugfix(x11): fix incorrect delta filtering Invert the mouse delta filter, so it aligns with the intention of filtering values lower than epsilon. Signed-off-by: John Nunley Closes: https://github.com/rust-windowing/winit/issues/3558 --- CHANGELOG.md | 2 ++ src/platform_impl/linux/x11/util/mouse.rs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e47594534f..0cdaec60fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ Unreleased` header. # Unreleased +- On X11, fix a bug where some mouse events would be unexpectedly filtered out. + # 0.29.13 - On Web, fix possible crash with `ControlFlow::Wait` and `ControlFlow::WaitUntil`. diff --git a/src/platform_impl/linux/x11/util/mouse.rs b/src/platform_impl/linux/x11/util/mouse.rs index 212ea57267..9f22266da3 100644 --- a/src/platform_impl/linux/x11/util/mouse.rs +++ b/src/platform_impl/linux/x11/util/mouse.rs @@ -30,8 +30,8 @@ macro_rules! consume { let this = $this; let (x, y) = match (this.x.abs() < <$ty>::EPSILON, this.y.abs() < <$ty>::EPSILON) { (true, true) => return None, - (true, false) => (this.x, 0.0), - (false, true) => (0.0, this.y), + (false, true) => (this.x, 0.0), + (true, false) => (0.0, this.y), (false, false) => (this.x, this.y), };