| 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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 //////////////////////////////////////////////////////////////////////////////// | 279 //////////////////////////////////////////////////////////////////////////////// |
| 280 // DesktopScreenX11, private: | 280 // DesktopScreenX11, private: |
| 281 | 281 |
| 282 DesktopScreenX11::DesktopScreenX11( | 282 DesktopScreenX11::DesktopScreenX11( |
| 283 const std::vector<display::Display>& test_displays) | 283 const std::vector<display::Display>& test_displays) |
| 284 : xdisplay_(gfx::GetXDisplay()), | 284 : xdisplay_(gfx::GetXDisplay()), |
| 285 x_root_window_(DefaultRootWindow(xdisplay_)), | 285 x_root_window_(DefaultRootWindow(xdisplay_)), |
| 286 has_xrandr_(false), | 286 has_xrandr_(false), |
| 287 xrandr_event_base_(0), | 287 xrandr_event_base_(0), |
| 288 displays_(test_displays), | 288 displays_(test_displays), |
| 289 primary_display_index_(0), |
| 289 atom_cache_(xdisplay_, kAtomsToCache) {} | 290 atom_cache_(xdisplay_, kAtomsToCache) {} |
| 290 | 291 |
| 291 std::vector<display::Display> DesktopScreenX11::BuildDisplaysFromXRandRInfo() { | 292 std::vector<display::Display> DesktopScreenX11::BuildDisplaysFromXRandRInfo() { |
| 292 std::vector<display::Display> displays; | 293 std::vector<display::Display> displays; |
| 293 gfx::XScopedPtr< | 294 gfx::XScopedPtr< |
| 294 XRRScreenResources, | 295 XRRScreenResources, |
| 295 gfx::XObjectDeleter<XRRScreenResources, void, XRRFreeScreenResources>> | 296 gfx::XObjectDeleter<XRRScreenResources, void, XRRFreeScreenResources>> |
| 296 resources(XRRGetScreenResourcesCurrent(xdisplay_, x_root_window_)); | 297 resources(XRRGetScreenResourcesCurrent(xdisplay_, x_root_window_)); |
| 297 if (!resources) { | 298 if (!resources) { |
| 298 LOG(ERROR) << "XRandR returned no displays. Falling back to Root Window."; | 299 LOG(ERROR) << "XRandR returned no displays. Falling back to Root Window."; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 GetPrimaryDisplay().device_scale_factor()); | 398 GetPrimaryDisplay().device_scale_factor()); |
| 398 } | 399 } |
| 399 | 400 |
| 400 //////////////////////////////////////////////////////////////////////////////// | 401 //////////////////////////////////////////////////////////////////////////////// |
| 401 | 402 |
| 402 display::Screen* CreateDesktopScreen() { | 403 display::Screen* CreateDesktopScreen() { |
| 403 return new DesktopScreenX11; | 404 return new DesktopScreenX11; |
| 404 } | 405 } |
| 405 | 406 |
| 406 } // namespace views | 407 } // namespace views |
| OLD | NEW |