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