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

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

Issue 1084453002: Fixed segmentation fault. Because currently return null when call views::LinuxUI::instance(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 gfx::Rect work_area_in_pixels; 280 gfx::Rect work_area_in_pixels;
281 std::vector<int> value; 281 std::vector<int> value;
282 if (ui::GetIntArrayProperty(x_root_window_, "_NET_WORKAREA", &value) && 282 if (ui::GetIntArrayProperty(x_root_window_, "_NET_WORKAREA", &value) &&
283 value.size() >= 4) { 283 value.size() >= 4) {
284 work_area_in_pixels = gfx::Rect(value[0], value[1], value[2], value[3]); 284 work_area_in_pixels = gfx::Rect(value[0], value[1], value[2], value[3]);
285 has_work_area = true; 285 has_work_area = true;
286 } 286 }
287 287
288 // As per-display scale factor is not supported right now, 288 // As per-display scale factor is not supported right now,
289 // the X11 root window's scale factor is always used. 289 // the X11 root window's scale factor is always used.
290 const float device_scale_factor = 290 const float device_scale_factor = GetDeviceScaleFactor();
291 views::LinuxUI::instance()->GetDeviceScaleFactor();
292 for (int i = 0; i < resources->noutput; ++i) { 291 for (int i = 0; i < resources->noutput; ++i) {
293 RROutput output_id = resources->outputs[i]; 292 RROutput output_id = resources->outputs[i];
294 gfx::XScopedPtr<XRROutputInfo, 293 gfx::XScopedPtr<XRROutputInfo,
295 gfx::XObjectDeleter<XRROutputInfo, void, XRRFreeOutputInfo>> 294 gfx::XObjectDeleter<XRROutputInfo, void, XRRFreeOutputInfo>>
296 output_info(XRRGetOutputInfo(xdisplay_, resources.get(), output_id)); 295 output_info(XRRGetOutputInfo(xdisplay_, resources.get(), output_id));
297 296
298 bool is_connected = (output_info->connection == RR_Connected); 297 bool is_connected = (output_info->connection == RR_Connected);
299 if (!is_connected) 298 if (!is_connected)
300 continue; 299 continue;
301 300
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 change_notifier_.NotifyDisplaysChanged(old_displays, displays_); 363 change_notifier_.NotifyDisplaysChanged(old_displays, displays_);
365 } 364 }
366 365
367 //////////////////////////////////////////////////////////////////////////////// 366 ////////////////////////////////////////////////////////////////////////////////
368 367
369 gfx::Screen* CreateDesktopScreen() { 368 gfx::Screen* CreateDesktopScreen() {
370 return new DesktopScreenX11; 369 return new DesktopScreenX11;
371 } 370 }
372 371
373 } // namespace views 372 } // 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