Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(519)

Unified Diff: components/mus/ws/event_dispatcher.cc

Issue 1998323002: EventDispatcher shouldn't always cancel on a hierarchy change (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: feedback Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/mus/ws/event_dispatcher_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/ws/event_dispatcher.cc
diff --git a/components/mus/ws/event_dispatcher.cc b/components/mus/ws/event_dispatcher.cc
index 96f7ddb949cafc2cc9751585514e2bc9b923a96d..4a092a6ee9a537414c1d6cdbb7cf254595d51100 100644
--- a/components/mus/ws/event_dispatcher.cc
+++ b/components/mus/ws/event_dispatcher.cc
@@ -510,7 +510,18 @@ Accelerator* EventDispatcher::FindAccelerator(
void EventDispatcher::OnWillChangeWindowHierarchy(ServerWindow* window,
ServerWindow* new_parent,
ServerWindow* old_parent) {
- CancelPointerEventsToTarget(window);
+ // TODO(sky): moving to a different root likely needs to transfer capture.
+ // TODO(sky): this isn't quite right, I think the logic should be (assuming
+ // moving in same root and still drawn):
+ // . if there is capture and window is still in the same root, continue
+ // sending to it.
+ // . if there isn't capture, then reevaluate each of the pointer targets
+ // sending exit as necessary.
+ // http://crbug.com/613646 .
+ if (!new_parent || !new_parent->IsDrawn() ||
+ new_parent->GetRoot() != old_parent->GetRoot()) {
+ CancelPointerEventsToTarget(window);
+ }
}
void EventDispatcher::OnWindowVisibilityChanged(ServerWindow* window) {
« no previous file with comments | « no previous file | components/mus/ws/event_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698