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

Unified Diff: services/ui/ws/window_tree.cc

Issue 2652713003: aura-mus: Make StackAtTop() proxy to the window manager. (Closed)
Patch Set: Add check to window_manager_delegate_ in WmStackAtTop. Created 3 years, 11 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 | « services/ui/ws/test_utils.cc ('k') | services/ui/ws/window_tree_client_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « services/ui/ws/test_utils.cc ('k') | services/ui/ws/window_tree_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698