Add -w (widescreen) and --geometry options to start-in-Xephyr. #570580
svn path=/trunk/; revision=187
This commit is contained in:
parent
153541841b
commit
cc4325ea79
@ -24,8 +24,8 @@ def _get_glx_extensions():
|
|||||||
return (server_glx_extensions, client_glx_extensions, glx_extensions)
|
return (server_glx_extensions, client_glx_extensions, glx_extensions)
|
||||||
|
|
||||||
class Launcher:
|
class Launcher:
|
||||||
def __init__(self):
|
def __init__(self, use_tfp=True, accept_geometry=False):
|
||||||
self.use_tfp = True
|
self.use_tfp = use_tfp
|
||||||
|
|
||||||
# Figure out the path to the plugin when uninstalled
|
# Figure out the path to the plugin when uninstalled
|
||||||
scripts_dir = os.path.dirname(os.path.abspath(sys.argv[0]))
|
scripts_dir = os.path.dirname(os.path.abspath(sys.argv[0]))
|
||||||
@ -40,6 +40,12 @@ class Launcher:
|
|||||||
parser.add_option("", "--debug-command", metavar="COMMAND",
|
parser.add_option("", "--debug-command", metavar="COMMAND",
|
||||||
help="Command to use for debugging (defaults to 'gdb --args')")
|
help="Command to use for debugging (defaults to 'gdb --args')")
|
||||||
parser.add_option("-v", "--verbose", action="store_true")
|
parser.add_option("-v", "--verbose", action="store_true")
|
||||||
|
if accept_geometry:
|
||||||
|
parser.add_option("", "--geometry", metavar="GEOMETRY",
|
||||||
|
help="Specify screen geometry",
|
||||||
|
default="1024x768");
|
||||||
|
parser.add_option("-w", "--wide", action="store_true",
|
||||||
|
help="Use widescreen (1280x800)")
|
||||||
|
|
||||||
self.options, args = parser.parse_args()
|
self.options, args = parser.parse_args()
|
||||||
|
|
||||||
@ -53,10 +59,8 @@ class Launcher:
|
|||||||
else:
|
else:
|
||||||
self.debug_command = ["gdb", "--args"]
|
self.debug_command = ["gdb", "--args"]
|
||||||
|
|
||||||
def set_use_tfp(self, use_tfp):
|
if self.options.wide:
|
||||||
"""Sets whether we try to use GLX_EXT_texture_for_pixmap"""
|
self.options.geometry = "1280x800"
|
||||||
|
|
||||||
self.use_tfp = use_tfp
|
|
||||||
|
|
||||||
def start_shell(self):
|
def start_shell(self):
|
||||||
"""Starts gnome-shell. Returns a subprocess.Popen object"""
|
"""Starts gnome-shell. Returns a subprocess.Popen object"""
|
||||||
@ -120,9 +124,10 @@ class Launcher:
|
|||||||
args.extend(['metacity', '--mutter-plugins=' + plugin, '--replace'])
|
args.extend(['metacity', '--mutter-plugins=' + plugin, '--replace'])
|
||||||
return subprocess.Popen(args, env=env)
|
return subprocess.Popen(args, env=env)
|
||||||
|
|
||||||
def is_verbose (self):
|
def is_verbose(self):
|
||||||
"""Returns whether the Launcher was started in verbose mode"""
|
"""Returns whether the Launcher was started in verbose mode"""
|
||||||
return self.options.verbose
|
return self.options.verbose
|
||||||
|
|
||||||
|
|
||||||
|
def get_geometry(self):
|
||||||
|
"""Returns the command-line specified geometry"""
|
||||||
|
return self.options.geometry
|
||||||
|
@ -11,10 +11,8 @@ import time
|
|||||||
|
|
||||||
from launcher import Launcher
|
from launcher import Launcher
|
||||||
|
|
||||||
launcher = Launcher()
|
|
||||||
|
|
||||||
# GL_EXT_texture_from_pixmap doesn't work in Xepyhr
|
# GL_EXT_texture_from_pixmap doesn't work in Xepyhr
|
||||||
launcher.set_use_tfp(False)
|
launcher = Launcher(use_tfp=False, accept_geometry=True)
|
||||||
|
|
||||||
# Temporary directory to hold our X credentials
|
# Temporary directory to hold our X credentials
|
||||||
tmpdir = tempfile.mkdtemp("", "gnome-shell.")
|
tmpdir = tempfile.mkdtemp("", "gnome-shell.")
|
||||||
@ -38,7 +36,7 @@ try:
|
|||||||
# Launch Xephyr
|
# Launch Xephyr
|
||||||
xephyr = subprocess.Popen(["Xephyr", display,
|
xephyr = subprocess.Popen(["Xephyr", display,
|
||||||
"-auth", xauth_file,
|
"-auth", xauth_file,
|
||||||
"-screen", "1024x748",
|
"-screen", launcher.get_geometry(),
|
||||||
"-host-cursor"])
|
"-host-cursor"])
|
||||||
os.environ['DISPLAY'] = display
|
os.environ['DISPLAY'] = display
|
||||||
os.environ['XAUTHORITY'] = xauth_file
|
os.environ['XAUTHORITY'] = xauth_file
|
||||||
|
Loading…
Reference in New Issue
Block a user