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 "chromeos/monitor/output_configurator.h" | 5 #include "chromeos/display/output_configurator.h" |
6 | 6 |
7 #include <X11/Xlib.h> | 7 #include <X11/Xlib.h> |
8 #include <X11/extensions/dpms.h> | 8 #include <X11/extensions/dpms.h> |
9 #include <X11/extensions/Xrandr.h> | 9 #include <X11/extensions/Xrandr.h> |
10 | 10 |
11 // Xlib defines Status as int which causes our include of dbus/bus.h to fail | 11 // Xlib defines Status as int which causes our include of dbus/bus.h to fail |
12 // when it tries to name an enum Status. Thus, we need to undefine it (note | 12 // when it tries to name an enum Status. Thus, we need to undefine it (note |
13 // that this will cause a problem if code needs to use the Status type). | 13 // that this will cause a problem if code needs to use the Status type). |
14 // RootWindow causes similar problems in that there is a Chromium type with that | 14 // RootWindow causes similar problems in that there is a Chromium type with that |
15 // name. | 15 // name. |
(...skipping 14 matching lines...) Expand all Loading... |
30 namespace chromeos { | 30 namespace chromeos { |
31 | 31 |
32 namespace { | 32 namespace { |
33 // DPI measurements. | 33 // DPI measurements. |
34 const float kMmInInch = 25.4; | 34 const float kMmInInch = 25.4; |
35 const float kDpi96 = 96.0; | 35 const float kDpi96 = 96.0; |
36 const float kPixelsToMmScale = kMmInInch / kDpi96; | 36 const float kPixelsToMmScale = kMmInInch / kDpi96; |
37 | 37 |
38 // The DPI threshold to detech high density screen. | 38 // The DPI threshold to detech high density screen. |
39 // Higher DPI than this will use device_scale_factor=2 | 39 // Higher DPI than this will use device_scale_factor=2 |
40 // Should be kept in sync with monitor_change_observer_x11.cc | 40 // Should be kept in sync with display_change_observer_x11.cc |
41 const unsigned int kHighDensityDIPThreshold = 160; | 41 const unsigned int kHighDensityDIPThreshold = 160; |
42 | 42 |
43 // Prefixes for the built-in displays. | 43 // Prefixes for the built-in displays. |
44 const char kInternal_LVDS[] = "LVDS"; | 44 const char kInternal_LVDS[] = "LVDS"; |
45 const char kInternal_eDP[] = "eDP"; | 45 const char kInternal_eDP[] = "eDP"; |
46 | 46 |
47 // Gap between screens so cursor at bottom of active monitor doesn't partially | 47 // Gap between screens so cursor at bottom of active display doesn't partially |
48 // appear on top of inactive monitor. Higher numbers guard against larger | 48 // appear on top of inactive display. Higher numbers guard against larger |
49 // cursors, but also waste more memory. We will double this gap for screens | 49 // cursors, but also waste more memory. We will double this gap for screens |
50 // with a device_scale_factor of 2. While this gap will not guard against all | 50 // with a device_scale_factor of 2. While this gap will not guard against all |
51 // possible cursors in X, it should handle the ones we actually use. See | 51 // possible cursors in X, it should handle the ones we actually use. See |
52 // crbug.com/130188 | 52 // crbug.com/130188 |
53 const int kVerticalGap = 30; | 53 const int kVerticalGap = 30; |
54 | 54 |
55 // TODO: Determine if we need to organize modes in a way which provides better | 55 // TODO: Determine if we need to organize modes in a way which provides better |
56 // than O(n) lookup time. In many call sites, for example, the "next" mode is | 56 // than O(n) lookup time. In many call sites, for example, the "next" mode is |
57 // typically what we are looking for so using this helper might be too | 57 // typically what we are looking for so using this helper might be too |
58 // expensive. | 58 // expensive. |
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 power_manager::kSetIsProjectingMethod); | 795 power_manager::kSetIsProjectingMethod); |
796 dbus::MessageWriter writer(&method_call); | 796 dbus::MessageWriter writer(&method_call); |
797 writer.AppendBool(is_projecting); | 797 writer.AppendBool(is_projecting); |
798 power_manager_proxy->CallMethod( | 798 power_manager_proxy->CallMethod( |
799 &method_call, | 799 &method_call, |
800 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, | 800 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, |
801 dbus::ObjectProxy::EmptyResponseCallback()); | 801 dbus::ObjectProxy::EmptyResponseCallback()); |
802 } | 802 } |
803 | 803 |
804 } // namespace chromeos | 804 } // namespace chromeos |
OLD | NEW |