| Index: components/mus/ws/event_dispatcher.cc
|
| diff --git a/components/mus/ws/event_dispatcher.cc b/components/mus/ws/event_dispatcher.cc
|
| index 2df70cadcf6cb314cdf9ee42e91d4fa687e30194..c7663cfc99f4c66ff140089f556cf91ea4d7437e 100644
|
| --- a/components/mus/ws/event_dispatcher.cc
|
| +++ b/components/mus/ws/event_dispatcher.cc
|
| @@ -141,7 +141,9 @@ class EventMatcher {
|
| ////////////////////////////////////////////////////////////////////////////////
|
|
|
| EventDispatcher::EventDispatcher(EventDispatcherDelegate* delegate)
|
| - : delegate_(delegate), root_(nullptr) {}
|
| + : delegate_(delegate),
|
| + root_(nullptr),
|
| + last_pointer_target_window_(nullptr) {}
|
|
|
| EventDispatcher::~EventDispatcher() {
|
| std::set<ServerWindow*> pointer_targets;
|
| @@ -263,6 +265,8 @@ void EventDispatcher::DispatchToPointerTarget(const PointerTarget& target,
|
| if (!target.window)
|
| return;
|
|
|
| + last_pointer_target_window_ = target.window;
|
| +
|
| gfx::Point location(EventLocationToPoint(*event));
|
| gfx::Transform transform(GetTransformToWindow(surface_id_, target.window));
|
| transform.TransformPoint(&location);
|
| @@ -313,6 +317,9 @@ void EventDispatcher::OnWindowVisibilityChanged(ServerWindow* window) {
|
|
|
| void EventDispatcher::OnWindowDestroyed(ServerWindow* window) {
|
| CancelPointerEventsToTarget(window);
|
| +
|
| + if (last_pointer_target_window_ == window)
|
| + last_pointer_target_window_ = nullptr;
|
| }
|
|
|
| } // namespace ws
|
|
|