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 "remoting/host/desktop_resizer.h" | 5 #include "remoting/host/desktop_resizer.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 #include <X11/extensions/Xrandr.h> | 8 #include <X11/extensions/Xrandr.h> |
9 #include <X11/Xlib.h> | 9 #include <X11/Xlib.h> |
10 | 10 |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/macros.h" |
12 #include "remoting/base/logging.h" | 13 #include "remoting/base/logging.h" |
13 #include "remoting/host/linux/x11_util.h" | 14 #include "remoting/host/linux/x11_util.h" |
14 | 15 |
15 // On Linux, we use the xrandr extension to change the desktop resolution. For | 16 // On Linux, we use the xrandr extension to change the desktop resolution. For |
16 // now, we only support resize-to-client for Xvfb-based servers that can match | 17 // now, we only support resize-to-client for Xvfb-based servers that can match |
17 // the client resolution exactly. To support best-resolution matching, it would | 18 // the client resolution exactly. To support best-resolution matching, it would |
18 // be necessary to implement |GetSupportedResolutions|, but it's not considered | 19 // be necessary to implement |GetSupportedResolutions|, but it's not considered |
19 // a priority now. | 20 // a priority now. |
20 // | 21 // |
21 // Xrandr has a number of restrictions that make this code more complex: | 22 // Xrandr has a number of restrictions that make this code more complex: |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 } | 322 } |
322 XRRSetCrtcConfig(display_, resources_.get(), resources_.GetCrtc(), | 323 XRRSetCrtcConfig(display_, resources_.get(), resources_.GetCrtc(), |
323 CurrentTime, 0, 0, mode_id, 1, outputs, number_of_outputs); | 324 CurrentTime, 0, 0, mode_id, 1, outputs, number_of_outputs); |
324 } | 325 } |
325 | 326 |
326 scoped_ptr<DesktopResizer> DesktopResizer::Create() { | 327 scoped_ptr<DesktopResizer> DesktopResizer::Create() { |
327 return make_scoped_ptr(new DesktopResizerX11); | 328 return make_scoped_ptr(new DesktopResizerX11); |
328 } | 329 } |
329 | 330 |
330 } // namespace remoting | 331 } // namespace remoting |
OLD | NEW |