| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/display/chromeos/x11/native_display_delegate_x11.h" | 5 #include "ui/display/chromeos/x11/native_display_delegate_x11.h" |
| 6 | 6 |
| 7 #include <X11/Xatom.h> | 7 #include <X11/Xatom.h> |
| 8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
| 9 #include <X11/extensions/dpms.h> | 9 #include <X11/extensions/dpms.h> |
| 10 #include <X11/extensions/Xrandr.h> | 10 #include <X11/extensions/Xrandr.h> |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 102 |
| 103 //////////////////////////////////////////////////////////////////////////////// | 103 //////////////////////////////////////////////////////////////////////////////// |
| 104 // NativeDisplayDelegateX11 implementation: | 104 // NativeDisplayDelegateX11 implementation: |
| 105 | 105 |
| 106 NativeDisplayDelegateX11::NativeDisplayDelegateX11() | 106 NativeDisplayDelegateX11::NativeDisplayDelegateX11() |
| 107 : display_(gfx::GetXDisplay()), | 107 : display_(gfx::GetXDisplay()), |
| 108 window_(DefaultRootWindow(display_)), | 108 window_(DefaultRootWindow(display_)), |
| 109 background_color_argb_(0) {} | 109 background_color_argb_(0) {} |
| 110 | 110 |
| 111 NativeDisplayDelegateX11::~NativeDisplayDelegateX11() { | 111 NativeDisplayDelegateX11::~NativeDisplayDelegateX11() { |
| 112 if (ui::PlatformEventSource::GetInstance()) { | 112 if (ui::PlatformEventSource::GetInstance() && |
| 113 platform_event_dispatcher_.get()) { |
| 113 ui::PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher( | 114 ui::PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher( |
| 114 platform_event_dispatcher_.get()); | 115 platform_event_dispatcher_.get()); |
| 115 } | 116 } |
| 116 | 117 |
| 117 STLDeleteContainerPairSecondPointers(modes_.begin(), modes_.end()); | 118 STLDeleteContainerPairSecondPointers(modes_.begin(), modes_.end()); |
| 118 } | 119 } |
| 119 | 120 |
| 120 void NativeDisplayDelegateX11::Initialize() { | 121 void NativeDisplayDelegateX11::Initialize() { |
| 121 int error_base_ignored = 0; | 122 int error_base_ignored = 0; |
| 122 int xrandr_event_base = 0; | 123 int xrandr_event_base = 0; |
| (...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 XSetForeground(display_, gc, color.pixel); | 655 XSetForeground(display_, gc, color.pixel); |
| 655 XSetFillStyle(display_, gc, FillSolid); | 656 XSetFillStyle(display_, gc, FillSolid); |
| 656 int width = DisplayWidth(display_, DefaultScreen(display_)); | 657 int width = DisplayWidth(display_, DefaultScreen(display_)); |
| 657 int height = DisplayHeight(display_, DefaultScreen(display_)); | 658 int height = DisplayHeight(display_, DefaultScreen(display_)); |
| 658 XFillRectangle(display_, window_, gc, 0, 0, width, height); | 659 XFillRectangle(display_, window_, gc, 0, 0, width, height); |
| 659 XFreeGC(display_, gc); | 660 XFreeGC(display_, gc); |
| 660 XFreeColors(display_, colormap, &color.pixel, 1, 0); | 661 XFreeColors(display_, colormap, &color.pixel, 1, 0); |
| 661 } | 662 } |
| 662 | 663 |
| 663 } // namespace ui | 664 } // namespace ui |
| OLD | NEW |