Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(324)

Unified Diff: remoting/host/linux/linux_me2me_host.py

Issue 1980163003: Xorg+dummy: set resolution to first size in list (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More flags, less duplication Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/linux/linux_me2me_host.py
diff --git a/remoting/host/linux/linux_me2me_host.py b/remoting/host/linux/linux_me2me_host.py
index 6050ee8546aedc16514a1d86bec1566f52193038..92b312add979a681de8a48e0903d443c0a44bad3 100755
--- a/remoting/host/linux/linux_me2me_host.py
+++ b/remoting/host/linux/linux_me2me_host.py
@@ -344,6 +344,8 @@ class Desktop:
self.xorg_conf = None
self.pulseaudio_pipe = None
self.server_supports_exact_resize = False
Sergey Ulanov 2016/05/18 20:38:17 do I understand it correctly that the X server doe
Lambros 2016/05/18 20:56:28 I think (correct me if I'm wrong), Xorg+dummy supp
rkjnsn 2016/05/18 21:02:16 Right. The current dummy driver does support resiz
+ self.server_supports_randr = False
+ self.randr_add_sizes = False
self.host_ready = False
self.ssh_auth_sockname = None
g_desktops.append(self)
@@ -467,9 +469,12 @@ class Desktop:
xvfb = locate_xvfb_randr()
if xvfb:
self.server_supports_exact_resize = True
+ self.server_supports_randr = True
+ self.randr_add_sizes = True
else:
xvfb = "Xvfb"
self.server_supports_exact_resize = False
+ self.server_supports_randr = False
logging.info("Starting %s on display :%d" % (xvfb, display))
screen_option = "%dx%dx24" % (max_width, max_height)
@@ -491,6 +496,8 @@ class Desktop:
# For now, we don't support exact resize with Xorg+dummy
Sergey Ulanov 2016/05/18 20:38:17 add . at the end of a comment please.
rkjnsn 2016/05/18 21:02:16 Acknowledged.
self.server_supports_exact_resize = False
+ # But dummy does support RandR 1.0
Sergey Ulanov 2016/05/18 20:38:17 same here
rkjnsn 2016/05/18 21:02:16 Acknowledged.
+ self.server_supports_randr = True
self.xorg_conf = config_file.name
logging.info("Starting Xorg on display :%d" % display)
@@ -574,19 +581,22 @@ class Desktop:
if retcode != 0:
logging.error("Failed to set XKB to 'evdev'")
- if not self.server_supports_exact_resize:
+ if not self.server_supports_randr:
return
- # Register the screen sizes if the X server's RANDR extension supports it.
- # Errors here are non-fatal; the X server will continue to run with the
- # dimensions from the "-screen" option.
- for width, height in self.sizes:
- label = "%dx%d" % (width, height)
- args = ["xrandr", "--newmode", label, "0", str(width), "0", "0", "0",
- str(height), "0", "0", "0"]
- subprocess.call(args, env=self.child_env, stdout=devnull, stderr=devnull)
- args = ["xrandr", "--addmode", "screen", label]
- subprocess.call(args, env=self.child_env, stdout=devnull, stderr=devnull)
+ # Register the screen sizes with RandR, if needed. Errors here are
+ # non-fatal; the X server will continue to run with the dimensions from the
+ # "-screen" option.
+ if self.randr_add_sizes:
+ for width, height in self.sizes:
+ label = "%dx%d" % (width, height)
+ args = ["xrandr", "--newmode", label, "0", str(width), "0", "0", "0",
+ str(height), "0", "0", "0"]
+ subprocess.call(args, env=self.child_env, stdout=devnull,
+ stderr=devnull)
+ args = ["xrandr", "--addmode", "screen", label]
+ subprocess.call(args, env=self.child_env, stdout=devnull,
+ stderr=devnull)
# Set the initial mode to the first size specified, otherwise the X server
# would default to (max_width, max_height), which might not even be in the
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698