OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/mus/ws/window_tree_impl.h" | 5 #include "components/mus/ws/window_tree_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 client_->OnWindowHierarchyChanged( | 402 client_->OnWindowHierarchyChanged( |
403 MapWindowIdToClient(window), MapWindowIdToClient(new_parent_id), | 403 MapWindowIdToClient(window), MapWindowIdToClient(new_parent_id), |
404 MapWindowIdToClient(old_parent_id), WindowsToWindowDatas(to_send)); | 404 MapWindowIdToClient(old_parent_id), WindowsToWindowDatas(to_send)); |
405 connection_manager_->OnConnectionMessagedClient(id_); | 405 connection_manager_->OnConnectionMessagedClient(id_); |
406 } | 406 } |
407 | 407 |
408 void WindowTreeImpl::ProcessWindowReorder(const ServerWindow* window, | 408 void WindowTreeImpl::ProcessWindowReorder(const ServerWindow* window, |
409 const ServerWindow* relative_window, | 409 const ServerWindow* relative_window, |
410 mojom::OrderDirection direction, | 410 mojom::OrderDirection direction, |
411 bool originated_change) { | 411 bool originated_change) { |
| 412 DCHECK_EQ(window->parent(), relative_window->parent()); |
412 if (originated_change || !IsWindowKnown(window) || | 413 if (originated_change || !IsWindowKnown(window) || |
413 !IsWindowKnown(relative_window) || | 414 !IsWindowKnown(relative_window) || |
414 connection_manager_->DidConnectionMessageClient(id_)) | 415 connection_manager_->DidConnectionMessageClient(id_)) |
415 return; | 416 return; |
416 | 417 |
| 418 // Do not notify ordering changes of the root windows, since the client |
| 419 // doesn't know about the ancestors of the roots, and so can't do anything |
| 420 // about this ordering change of the root. |
| 421 if (HasRoot(window) || HasRoot(relative_window)) |
| 422 return; |
| 423 |
417 client_->OnWindowReordered(MapWindowIdToClient(window), | 424 client_->OnWindowReordered(MapWindowIdToClient(window), |
418 MapWindowIdToClient(relative_window), direction); | 425 MapWindowIdToClient(relative_window), direction); |
419 connection_manager_->OnConnectionMessagedClient(id_); | 426 connection_manager_->OnConnectionMessagedClient(id_); |
420 } | 427 } |
421 | 428 |
422 void WindowTreeImpl::ProcessWindowDeleted(const ServerWindow* window, | 429 void WindowTreeImpl::ProcessWindowDeleted(const ServerWindow* window, |
423 bool originated_change) { | 430 bool originated_change) { |
424 if (window->id().connection_id == id_) | 431 if (window->id().connection_id == id_) |
425 window_map_.erase(window->id().window_id); | 432 window_map_.erase(window->id().window_id); |
426 | 433 |
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1151 | 1158 |
1152 for (const auto* root : roots_) { | 1159 for (const auto* root : roots_) { |
1153 if (root->Contains(window)) | 1160 if (root->Contains(window)) |
1154 return true; | 1161 return true; |
1155 } | 1162 } |
1156 return false; | 1163 return false; |
1157 } | 1164 } |
1158 | 1165 |
1159 } // namespace ws | 1166 } // namespace ws |
1160 } // namespace mus | 1167 } // namespace mus |
OLD | NEW |