Destruction should instead happen after the windowmanager umembeds. To do otherwise means the windowmanager sees window destruction, which can cause all sorts of timing issues.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/54ff2ccef79fedc2a991f9c9b66e64d0c781cfc5 commit 54ff2ccef79fedc2a991f9c9b66e64d0c781cfc5 Author: sky <sky@chromium.org> Date: Tue Sep 20 02:44:41 2016 Makes display roots be destroyed by client Prior to this patch when a display was destroyed the client would get a delete notification for the root. This is problematic as the client may need to delete the root after a delay (as happens in ash). This patch changes it so the client is notified of the display removal and it's up to the client to then delete the window when they want to. BUG= 647512 TEST=covered by tests R=sadrul@chromium.org Review-Url: https://codereview.chromium.org/2346253004 Cr-Commit-Position: refs/heads/master@{#419658} [modify] https://crrev.com/54ff2ccef79fedc2a991f9c9b66e64d0c781cfc5/ash/mus/window_manager.cc [modify] https://crrev.com/54ff2ccef79fedc2a991f9c9b66e64d0c781cfc5/ash/mus/window_manager.h [modify] https://crrev.com/54ff2ccef79fedc2a991f9c9b66e64d0c781cfc5/services/ui/demo/mus_demo.cc [modify] https://crrev.com/54ff2ccef79fedc2a991f9c9b66e64d0c781cfc5/services/ui/demo/mus_demo.h [modify] https://crrev.com/54ff2ccef79fedc2a991f9c9b66e64d0c781cfc5/services/ui/public/cpp/tests/window_server_test_base.cc [modify] https://crrev.com/54ff2ccef79fedc2a991f9c9b66e64d0c781cfc5/services/ui/public/cpp/tests/window_server_test_base.h [modify] https://crrev.com/54ff2ccef79fedc2a991f9c9b66e64d0c781cfc5/services/ui/public/cpp/window_manager_delegate.h [modify] https://crrev.com/54ff2ccef79fedc2a991f9c9b66e64d0c781cfc5/services/ui/public/cpp/window_tree_client.cc [modify] https://crrev.com/54ff2ccef79fedc2a991f9c9b66e64d0c781cfc5/services/ui/public/cpp/window_tree_client.h [modify] https://crrev.com/54ff2ccef79fedc2a991f9c9b66e64d0c781cfc5/services/ui/public/interfaces/window_manager.mojom [modify] https://crrev.com/54ff2ccef79fedc2a991f9c9b66e64d0c781cfc5/services/ui/test_wm/test_wm.cc [modify] https://crrev.com/54ff2ccef79fedc2a991f9c9b66e64d0c781cfc5/services/ui/ws/display.cc [modify] https://crrev.com/54ff2ccef79fedc2a991f9c9b66e64d0c781cfc5/services/ui/ws/display.h [modify] https://crrev.com/54ff2ccef79fedc2a991f9c9b66e64d0c781cfc5/services/ui/ws/display_unittest.cc [modify] https://crrev.com/54ff2ccef79fedc2a991f9c9b66e64d0c781cfc5/services/ui/ws/test_utils.cc [modify] https://crrev.com/54ff2ccef79fedc2a991f9c9b66e64d0c781cfc5/services/ui/ws/test_utils.h [modify] https://crrev.com/54ff2ccef79fedc2a991f9c9b66e64d0c781cfc5/services/ui/ws/window_manager_client_unittest.cc [modify] https://crrev.com/54ff2ccef79fedc2a991f9c9b66e64d0c781cfc5/services/ui/ws/window_manager_display_root.h [modify] https://crrev.com/54ff2ccef79fedc2a991f9c9b66e64d0c781cfc5/services/ui/ws/window_manager_state.cc [modify] https://crrev.com/54ff2ccef79fedc2a991f9c9b66e64d0c781cfc5/services/ui/ws/window_manager_state.h [modify] https://crrev.com/54ff2ccef79fedc2a991f9c9b66e64d0c781cfc5/services/ui/ws/window_server.cc [modify] https://crrev.com/54ff2ccef79fedc2a991f9c9b66e64d0c781cfc5/services/ui/ws/window_tree.cc [modify] https://crrev.com/54ff2ccef79fedc2a991f9c9b66e64d0c781cfc5/services/ui/ws/window_tree.h [modify] https://crrev.com/54ff2ccef79fedc2a991f9c9b66e64d0c781cfc5/services/ui/ws/window_tree_client_unittest.cc
Comment 1 by sky@chromium.org
, Sep 16 2016