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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 bool is_connected = (output_info->connection == RR_Connected); | 303 bool is_connected = (output_info->connection == RR_Connected); |
304 if (!is_connected) | 304 if (!is_connected) |
305 continue; | 305 continue; |
306 | 306 |
307 if (output_info->crtc) { | 307 if (output_info->crtc) { |
308 gfx::XScopedPtr<XRRCrtcInfo, | 308 gfx::XScopedPtr<XRRCrtcInfo, |
309 gfx::XObjectDeleter<XRRCrtcInfo, void, XRRFreeCrtcInfo>> | 309 gfx::XObjectDeleter<XRRCrtcInfo, void, XRRFreeCrtcInfo>> |
310 crtc(XRRGetCrtcInfo(xdisplay_, resources.get(), output_info->crtc)); | 310 crtc(XRRGetCrtcInfo(xdisplay_, resources.get(), output_info->crtc)); |
311 | 311 |
312 int64_t display_id = -1; | 312 int64_t display_id = -1; |
313 if (!ui::EDIDParserX11(output_id).GetDisplayId(static_cast<uint8_t>(i), | 313 if (!ui::GetDisplayId(output_id, static_cast<uint8_t>(i), &display_id)) { |
314 &display_id)) { | |
315 // It isn't ideal, but if we can't parse the EDID data, fallback on the | 314 // It isn't ideal, but if we can't parse the EDID data, fallback on the |
316 // display number. | 315 // display number. |
317 display_id = i; | 316 display_id = i; |
318 } | 317 } |
319 | 318 |
320 gfx::Rect crtc_bounds(crtc->x, crtc->y, crtc->width, crtc->height); | 319 gfx::Rect crtc_bounds(crtc->x, crtc->y, crtc->width, crtc->height); |
321 gfx::Display display(display_id, crtc_bounds); | 320 gfx::Display display(display_id, crtc_bounds); |
322 | 321 |
323 if (!gfx::Display::HasForceDeviceScaleFactor()) { | 322 if (!gfx::Display::HasForceDeviceScaleFactor()) { |
324 display.SetScaleAndBounds(device_scale_factor, crtc_bounds); | 323 display.SetScaleAndBounds(device_scale_factor, crtc_bounds); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 change_notifier_.NotifyDisplaysChanged(old_displays, displays_); | 367 change_notifier_.NotifyDisplaysChanged(old_displays, displays_); |
369 } | 368 } |
370 | 369 |
371 //////////////////////////////////////////////////////////////////////////////// | 370 //////////////////////////////////////////////////////////////////////////////// |
372 | 371 |
373 gfx::Screen* CreateDesktopScreen() { | 372 gfx::Screen* CreateDesktopScreen() { |
374 return new DesktopScreenX11; | 373 return new DesktopScreenX11; |
375 } | 374 } |
376 | 375 |
377 } // namespace views | 376 } // namespace views |
OLD | NEW |