| 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 "services/ui/ws/window_server.h" | 5 #include "services/ui/ws/window_server.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 // Returns true if |window| is considered the active window manager for | 36 // Returns true if |window| is considered the active window manager for |
| 37 // |display|. | 37 // |display|. |
| 38 bool IsWindowConsideredWindowManagerRoot(const Display* display, | 38 bool IsWindowConsideredWindowManagerRoot(const Display* display, |
| 39 const ServerWindow* window) { | 39 const ServerWindow* window) { |
| 40 if (!display) | 40 if (!display) |
| 41 return false; | 41 return false; |
| 42 | 42 |
| 43 const WindowManagerDisplayRoot* display_root = | 43 const WindowManagerDisplayRoot* display_root = |
| 44 display->GetActiveWindowManagerDisplayRoot(); | 44 display->GetActiveWindowManagerDisplayRoot(); |
| 45 if (!display_root) | 45 return display_root && display_root->GetClientVisibileRoot() == window; |
| 46 return false; | |
| 47 | |
| 48 if (window == display_root->root()) | |
| 49 return true; | |
| 50 | |
| 51 // If the window manager manually creates displays then there is an extra | |
| 52 // window, the window supplied via SetDisplayRoot(). | |
| 53 return !display_root->window_manager_state() | |
| 54 ->window_tree() | |
| 55 ->automatically_create_display_roots() && | |
| 56 window->parent() == display_root->root(); | |
| 57 } | 46 } |
| 58 | 47 |
| 59 } // namespace | 48 } // namespace |
| 60 | 49 |
| 61 struct WindowServer::CurrentMoveLoopState { | 50 struct WindowServer::CurrentMoveLoopState { |
| 62 uint32_t change_id; | 51 uint32_t change_id; |
| 63 ServerWindow* window; | 52 ServerWindow* window; |
| 64 WindowTree* initiator; | 53 WindowTree* initiator; |
| 65 gfx::Rect revert_bounds; | 54 gfx::Rect revert_bounds; |
| 66 }; | 55 }; |
| (...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 882 void WindowServer::OnUserIdAdded(const UserId& id) { | 871 void WindowServer::OnUserIdAdded(const UserId& id) { |
| 883 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); | 872 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); |
| 884 } | 873 } |
| 885 | 874 |
| 886 void WindowServer::OnUserIdRemoved(const UserId& id) { | 875 void WindowServer::OnUserIdRemoved(const UserId& id) { |
| 887 activity_monitor_map_.erase(id); | 876 activity_monitor_map_.erase(id); |
| 888 } | 877 } |
| 889 | 878 |
| 890 } // namespace ws | 879 } // namespace ws |
| 891 } // namespace ui | 880 } // namespace ui |
| OLD | NEW |