OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/views/widget/desktop_aura/desktop_screen_x11.h" | 5 #include "ui/views/widget/desktop_aura/desktop_screen_x11.h" |
6 | 6 |
7 #include <X11/extensions/Xrandr.h> | 7 #include <X11/extensions/Xrandr.h> |
8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
9 | 9 |
10 // It clashes with out RootWindow. | 10 // It clashes with out RootWindow. |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 const gfx::Point& point) { | 158 const gfx::Point& point) { |
159 X11TopmostWindowFinder finder; | 159 X11TopmostWindowFinder finder; |
160 return finder.FindLocalProcessWindowAt( | 160 return finder.FindLocalProcessWindowAt( |
161 DIPToPixelPoint(point), std::set<aura::Window*>()); | 161 DIPToPixelPoint(point), std::set<aura::Window*>()); |
162 } | 162 } |
163 | 163 |
164 int DesktopScreenX11::GetNumDisplays() const { | 164 int DesktopScreenX11::GetNumDisplays() const { |
165 return displays_.size(); | 165 return displays_.size(); |
166 } | 166 } |
167 | 167 |
168 std::vector<display::Display> DesktopScreenX11::GetAllDisplays() const { | 168 const std::vector<display::Display>& DesktopScreenX11::GetAllDisplays() const { |
169 return displays_; | 169 return displays_; |
170 } | 170 } |
171 | 171 |
172 display::Display DesktopScreenX11::GetDisplayNearestWindow( | 172 display::Display DesktopScreenX11::GetDisplayNearestWindow( |
173 gfx::NativeView window) const { | 173 gfx::NativeView window) const { |
174 if (!window) | 174 if (!window) |
175 return GetPrimaryDisplay(); | 175 return GetPrimaryDisplay(); |
176 | 176 |
177 // Getting screen bounds here safely is hard. | 177 // Getting screen bounds here safely is hard. |
178 // | 178 // |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 GetPrimaryDisplay().device_scale_factor()); | 403 GetPrimaryDisplay().device_scale_factor()); |
404 } | 404 } |
405 | 405 |
406 //////////////////////////////////////////////////////////////////////////////// | 406 //////////////////////////////////////////////////////////////////////////////// |
407 | 407 |
408 display::Screen* CreateDesktopScreen() { | 408 display::Screen* CreateDesktopScreen() { |
409 return new DesktopScreenX11; | 409 return new DesktopScreenX11; |
410 } | 410 } |
411 | 411 |
412 } // namespace views | 412 } // namespace views |
OLD | NEW |