Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@localhost.localdomain>2006-10-16 15:22:05 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2006-10-16 15:22:05 (GMT)
commit781988589a012c07959dc391d87b9a4b33b8fae1 (patch)
treecbb6bc0f765579652a0099e25600cd1bb81eeee7
parentf98956acda4402520e517c5d2985b54dc60d2049 (diff)
Add a fullscreen option to the emulator
-rwxr-xr-xsugar-emulator14
-rw-r--r--sugar/emulator.py15
2 files changed, 21 insertions, 8 deletions
diff --git a/sugar-emulator b/sugar-emulator
index a49eee8..4973e08 100755
--- a/sugar-emulator
+++ b/sugar-emulator
@@ -34,11 +34,17 @@ env.setup_system()
from sugar.emulator import Emulator
-emulator = Emulator()
+program = 'sugar-shell'
+
+fullscreen = False
+for i in range(1, len(sys.argv)):
+ if sys.argv[i] == '-fullscreen':
+ fullscreen = True
+ else:
+ program = sys.argv[i]
+
+emulator = Emulator(fullscreen)
emulator.start()
-program = 'sugar-shell'
-if len(sys.argv) > 1:
- program = sys.argv[1]
os.execlp('dbus-launch', 'dbus-launch', '--exit-with-session',
'--config-file=%s' % env.get_dbus_config(), program)
diff --git a/sugar/emulator.py b/sugar/emulator.py
index 78d39d2..f1f0b3d 100644
--- a/sugar/emulator.py
+++ b/sugar/emulator.py
@@ -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: