Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(358)

Side by Side Diff: ui/views/widget/desktop_aura/desktop_screen_x11.cc

Issue 1985303002: Reland of iews: Initialize DesktopScreenX11::primary_display_index_. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698