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

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

Issue 1985283002: Revert of views: 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),
290 atom_cache_(xdisplay_, kAtomsToCache) {} 289 atom_cache_(xdisplay_, kAtomsToCache) {}
291 290
292 std::vector<display::Display> DesktopScreenX11::BuildDisplaysFromXRandRInfo() { 291 std::vector<display::Display> DesktopScreenX11::BuildDisplaysFromXRandRInfo() {
293 std::vector<display::Display> displays; 292 std::vector<display::Display> displays;
294 gfx::XScopedPtr< 293 gfx::XScopedPtr<
295 XRRScreenResources, 294 XRRScreenResources,
296 gfx::XObjectDeleter<XRRScreenResources, void, XRRFreeScreenResources>> 295 gfx::XObjectDeleter<XRRScreenResources, void, XRRFreeScreenResources>>
297 resources(XRRGetScreenResourcesCurrent(xdisplay_, x_root_window_)); 296 resources(XRRGetScreenResourcesCurrent(xdisplay_, x_root_window_));
298 if (!resources) { 297 if (!resources) {
299 LOG(ERROR) << "XRandR returned no displays. Falling back to Root Window."; 298 LOG(ERROR) << "XRandR returned no displays. Falling back to Root Window.";
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 GetPrimaryDisplay().device_scale_factor()); 397 GetPrimaryDisplay().device_scale_factor());
399 } 398 }
400 399
401 //////////////////////////////////////////////////////////////////////////////// 400 ////////////////////////////////////////////////////////////////////////////////
402 401
403 display::Screen* CreateDesktopScreen() { 402 display::Screen* CreateDesktopScreen() {
404 return new DesktopScreenX11; 403 return new DesktopScreenX11;
405 } 404 }
406 405
407 } // namespace views 406 } // 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