Add a fullscreen option to the emulator

This commit is contained in:
Marco Pesenti Gritti
2006-10-16 17:22:05 +02:00
parent f98956acda
commit 781988589a
2 changed files with 21 additions and 8 deletions
+11 -4
View File
@@ -77,9 +77,13 @@ class MatchboxProcess(Process):
return 'Matchbox'
class XephyrProcess(Process):
def __init__(self):
def __init__(self, fullscreen):
self._display = get_display_number()
cmd = 'Xephyr :%d -ac -screen 800x600' % (self._display)
cmd = 'Xephyr :%d -ac ' % (self._display)
if fullscreen:
cmd += '-fullscreen '
else:
cmd += '-screen 800x600 '
Process.__init__(self, cmd)
def get_name(self):
@@ -102,11 +106,14 @@ class XnestProcess(Process):
Process.start(self)
os.environ['DISPLAY'] = ":%d" % (self._display)
class Emulator:
class Emulator(object):
"""The OLPC emulator"""
def __init__(self, fullscreen):
self._fullscreen = fullscreen
def start(self):
try:
process = XephyrProcess()
process = XephyrProcess(self._fullscreen)
process.start()
except:
try: