bugfix: Replace pointer dereference with read_unaligned

On Raspberry Pi, using the Rust crate eframe caused the program to crash on
mouse movement. The Backtrace lead to this specific line of code, and the exact
error was a "misaligned pointer dereference: address must be a multiple of 0x8
but is xxxx"

The edit has been tested with the Raspberry Pi, which works now.
This commit is contained in:
Kevin Müller
2024-05-20 00:08:14 +02:00
committed by Kirill Chibisov
parent c4a8e9321d
commit 1afec3ca0d

View File

@@ -1424,7 +1424,7 @@ impl EventProcessor {
if !xinput2::XIMaskIsSet(mask, i) {
continue;
}
let x = unsafe { *value };
let x = unsafe { value.read_unaligned() };
// We assume that every XInput2 device with analog axes is a pointing device emitting
// relative coordinates.