Rework ScriptThread::handle_input_event for behaviour and performance (#36619)

Rework `ScriptThread::handle_input_event` for correct behaviour and
better performance
1. Only trigger click event with primary button, according to spec
2. Avoid unnecessary clone of `ConstellationInputEvent`

This is a follow up of #36413 

Testing: Manually tested. Right mouse won't trigger click event now.
Fixes: #35666 
cc @jdm @xiaochengh

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
This commit is contained in:
Euclid Ye 2025-04-21 11:34:39 +08:00 committed by GitHub
parent 76ee127af8
commit 990ed8891f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 31 additions and 33 deletions

View file

@ -51,7 +51,7 @@ pub struct MouseButtonEvent {
pub point: DevicePoint,
}
#[derive(Clone, Copy, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
pub enum MouseButton {
Left,
Middle,