| Index: services/ui/ws/window_tree.cc
|
| diff --git a/services/ui/ws/window_tree.cc b/services/ui/ws/window_tree.cc
|
| index 77fd68d27593e422e7f7bb13f46894584bdf0988..1fb3e481e9fa42ffc638627e8c523b92c7417b7c 100644
|
| --- a/services/ui/ws/window_tree.cc
|
| +++ b/services/ui/ws/window_tree.cc
|
| @@ -1625,13 +1625,21 @@ void WindowTree::StackAtTop(uint32_t change_id, Id window_id) {
|
| return;
|
| }
|
|
|
| - ServerWindow* relative_window = parent->children().back();
|
| - Operation op(this, window_server_, OperationType::REORDER_WINDOW);
|
| - window->Reorder(relative_window, mojom::OrderDirection::ABOVE);
|
| - window_server_->ProcessWindowReorder(window, relative_window,
|
| - mojom::OrderDirection::ABOVE);
|
| + WindowManagerDisplayRoot* display_root = GetWindowManagerDisplayRoot(window);
|
| + if (!display_root) {
|
| + DVLOG(1) << "StackAtTop (no display root)";
|
| + client()->OnChangeCompleted(change_id, false);
|
| + return;
|
| + }
|
|
|
| - client()->OnChangeCompleted(change_id, true);
|
| + // Window reordering assumes that it is the owner of parent who is sending
|
| + // the message, and does not deal gracefully with other clients reordering
|
| + // their windows. So tell the window manager to send us a reorder message.
|
| + WindowTree* wm_tree = display_root->window_manager_state()->window_tree();
|
| + const uint32_t wm_change_id =
|
| + window_server_->GenerateWindowManagerChangeId(this, change_id);
|
| + wm_tree->window_manager_internal_->WmStackAtTop(
|
| + wm_change_id, wm_tree->ClientWindowIdForWindow(window).id);
|
| }
|
|
|
| void WindowTree::GetWindowManagerClient(
|
|
|