Skip to content

Commit

Permalink
fix(linux): prevent firing duplicate mouse events (fixes #939) (#941)
Browse files Browse the repository at this point in the history
* fix(linux): prevent firing duplicate mouse events (#939)

* Add change file

* Update .changes/bump.md

Co-authored-by: Ngo Iok Ui (Wu Yu Wei) <[email protected]>

---------

Co-authored-by: Ngo Iok Ui (Wu Yu Wei) <[email protected]>
  • Loading branch information
Sanae6 and wusyong authored Jun 24, 2024
1 parent b20d500 commit e67cf1b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changes/bump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tao": "patch"
---

Prevent duplicate mouse press, release, and motion events from firing on Linux (fixes #939)
8 changes: 4 additions & 4 deletions src/platform_impl/linux/event_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ impl<T: 'static> EventLoop<T> {
}
}
}
glib::Propagation::Proceed
glib::Propagation::Stop
});

let tx_clone = event_tx.clone();
Expand Down Expand Up @@ -675,11 +675,11 @@ impl<T: 'static> EventLoop<T> {
},
}) {
log::warn!(
"Failed to send mouse input preseed event to event channel: {}",
"Failed to send mouse input pressed event to event channel: {}",
e
);
}
glib::Propagation::Proceed
glib::Propagation::Stop
});

let tx_clone = event_tx.clone();
Expand All @@ -705,7 +705,7 @@ impl<T: 'static> EventLoop<T> {
e
);
}
glib::Propagation::Proceed
glib::Propagation::Stop
});

let tx_clone = event_tx.clone();
Expand Down

0 comments on commit e67cf1b

Please sign in to comment.