Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

address issue where mouse down events weren't getting captured after the multiple handlers change

Kay Simmons75b8a12ab37a
diff --git a/crates/gpui/src/presenter.rs b/crates/gpui/src/presenter.rs
index c988bb330be..d15051ef126 100644
--- a/crates/gpui/src/presenter.rs
+++ b/crates/gpui/src/presenter.rs
@@ -485,7 +485,7 @@ impl Presenter {
}
// `event_consumed` should only be true if there are any handlers for this event.
- let mut event_consumed = false;
+ let mut event_consumed = event_cx.handled;
if let Some(callbacks) = valid_region.handlers.get(&mouse_event.handler_key()) {
event_consumed = true;
for callback in callbacks {
@@ -499,6 +499,8 @@ impl Presenter {
}
}
+ any_event_handled |= event_cx.handled;
+
// For bubbling events, if the event was handled, don't continue dispatching.
// This only makes sense for local events which return false from is_capturable.
if event_consumed && mouse_event.is_capturable() {