| 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/aura/monitor_change_observer_x11.h" | 5 #include "ui/aura/monitor_change_observer_x11.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include <X11/extensions/Xrandr.h> | 12 #include <X11/extensions/Xrandr.h> |
| 13 | 13 |
| 14 #include "base/message_pump_x.h" | 14 #include "base/message_pump_aurax11.h" |
| 15 #include "ui/aura/env.h" | 15 #include "ui/aura/env.h" |
| 16 #include "ui/aura/dispatcher_linux.h" | 16 #include "ui/aura/dispatcher_linux.h" |
| 17 #include "ui/aura/monitor_manager.h" | 17 #include "ui/aura/monitor_manager.h" |
| 18 #include "ui/compositor/dip_util.h" | 18 #include "ui/compositor/dip_util.h" |
| 19 #include "ui/gfx/monitor.h" | 19 #include "ui/gfx/monitor.h" |
| 20 | 20 |
| 21 namespace aura { | 21 namespace aura { |
| 22 namespace internal { | 22 namespace internal { |
| 23 | 23 |
| 24 namespace { | 24 namespace { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 39 return NULL; | 39 return NULL; |
| 40 } | 40 } |
| 41 | 41 |
| 42 bool CompareMonitorY(const gfx::Monitor& lhs, const gfx::Monitor& rhs) { | 42 bool CompareMonitorY(const gfx::Monitor& lhs, const gfx::Monitor& rhs) { |
| 43 return lhs.bounds_in_pixel().y() > rhs.bounds_in_pixel().y(); | 43 return lhs.bounds_in_pixel().y() > rhs.bounds_in_pixel().y(); |
| 44 } | 44 } |
| 45 | 45 |
| 46 } // namespace | 46 } // namespace |
| 47 | 47 |
| 48 MonitorChangeObserverX11::MonitorChangeObserverX11() | 48 MonitorChangeObserverX11::MonitorChangeObserverX11() |
| 49 : xdisplay_(base::MessagePumpX::GetDefaultXDisplay()), | 49 : xdisplay_(base::MessagePumpAuraX11::GetDefaultXDisplay()), |
| 50 x_root_window_(DefaultRootWindow(xdisplay_)), | 50 x_root_window_(DefaultRootWindow(xdisplay_)), |
| 51 xrandr_event_base_(0) { | 51 xrandr_event_base_(0) { |
| 52 XRRSelectInput(xdisplay_, x_root_window_, RRScreenChangeNotifyMask); | 52 XRRSelectInput(xdisplay_, x_root_window_, RRScreenChangeNotifyMask); |
| 53 int error_base_ignored; | 53 int error_base_ignored; |
| 54 XRRQueryExtension(xdisplay_, &xrandr_event_base_, &error_base_ignored); | 54 XRRQueryExtension(xdisplay_, &xrandr_event_base_, &error_base_ignored); |
| 55 static_cast<DispatcherLinux*>(Env::GetInstance()->GetDispatcher())-> | 55 static_cast<DispatcherLinux*>(Env::GetInstance()->GetDispatcher())-> |
| 56 AddDispatcherForRootWindow(this); | 56 AddDispatcherForRootWindow(this); |
| 57 } | 57 } |
| 58 | 58 |
| 59 MonitorChangeObserverX11::~MonitorChangeObserverX11() { | 59 MonitorChangeObserverX11::~MonitorChangeObserverX11() { |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 for (std::vector<gfx::Monitor>::iterator iter = monitors.begin(); | 135 for (std::vector<gfx::Monitor>::iterator iter = monitors.begin(); |
| 136 iter != monitors.end(); ++iter, ++id) | 136 iter != monitors.end(); ++iter, ++id) |
| 137 (*iter).set_id(id); | 137 (*iter).set_id(id); |
| 138 | 138 |
| 139 Env::GetInstance()->monitor_manager() | 139 Env::GetInstance()->monitor_manager() |
| 140 ->OnNativeMonitorsChanged(monitors); | 140 ->OnNativeMonitorsChanged(monitors); |
| 141 } | 141 } |
| 142 | 142 |
| 143 } // namespace internal | 143 } // namespace internal |
| 144 } // namespace aura | 144 } // namespace aura |
| OLD | NEW |