Don't call to update native cursor from WS when removing a window.
When we remove a window, e.g. opening the network settings page, which is going to remove the status tray bubble window, we changes the window hierarchy and updates cursor provider for the old parent [1], which finds the target based on the last mouse location. Viz hasn't been notified of this change yet and the status tray bubble window is still in the window mappings in mus-ws (until destroyed), so we still finds this status tray bubble window as target with --use-viz-hit-test. Then when we adjust this target for modal window, we fail to find its root window [2]. [1] https://cs.chromium.org/chromium/src/services/ui/ws/window_server.cc?gsn=GetRootForDrawn&l=920 [2] https://cs.chromium.org/chromium/src/services/ui/ws/event_dispatcher.cc?type=cs&l=362 This CL checks if we are actually removing a window before we call to update native cursor in WS; the logic for moving a window from one display to another remains unchanged. When we remove a window, EventDispatcher::WindowNoLongerValidTarget is going update cursor if necessary, so there's no need to call to update cursor in WindowServer::OnWindowHierarchyChanged and do the work twice. Bug: 788185 Change-Id: I48a7bfa4e981ae1b768768b0f011e53d6b968451 Reviewed-on: https://chromium-review.googlesource.com/788230 Commit-Queue: Ria Jiang <riajiang@chromium.org> Reviewed-by:Sadrul Chowdhury <sadrul@chromium.org> Cr-Commit-Position: refs/heads/master@{#519162}
Showing
Please register or sign in to comment