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::GetDisplayId(output_id, static_cast<uint8_t>(i), &display_id)) { | 313 if (!ui::EDIDParserX11(output_id).GetDisplayId(static_cast<uint8_t>(i), |
| 314 &display_id)) { |
314 // It isn't ideal, but if we can't parse the EDID data, fallback on the | 315 // It isn't ideal, but if we can't parse the EDID data, fallback on the |
315 // display number. | 316 // display number. |
316 display_id = i; | 317 display_id = i; |
317 } | 318 } |
318 | 319 |
319 gfx::Rect crtc_bounds(crtc->x, crtc->y, crtc->width, crtc->height); | 320 gfx::Rect crtc_bounds(crtc->x, crtc->y, crtc->width, crtc->height); |
320 gfx::Display display(display_id, crtc_bounds); | 321 gfx::Display display(display_id, crtc_bounds); |
321 | 322 |
322 if (!gfx::Display::HasForceDeviceScaleFactor()) { | 323 if (!gfx::Display::HasForceDeviceScaleFactor()) { |
323 display.SetScaleAndBounds(device_scale_factor, crtc_bounds); | 324 display.SetScaleAndBounds(device_scale_factor, crtc_bounds); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 change_notifier_.NotifyDisplaysChanged(old_displays, displays_); | 368 change_notifier_.NotifyDisplaysChanged(old_displays, displays_); |
368 } | 369 } |
369 | 370 |
370 //////////////////////////////////////////////////////////////////////////////// | 371 //////////////////////////////////////////////////////////////////////////////// |
371 | 372 |
372 gfx::Screen* CreateDesktopScreen() { | 373 gfx::Screen* CreateDesktopScreen() { |
373 return new DesktopScreenX11; | 374 return new DesktopScreenX11; |
374 } | 375 } |
375 | 376 |
376 } // namespace views | 377 } // namespace views |
OLD | NEW |