Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar/emulator.py
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <mpg@redhat.com>2007-01-31 16:49:56 (GMT)
committer Marco Pesenti Gritti <mpg@redhat.com>2007-01-31 16:49:56 (GMT)
commitc1c5a78ca8d653fd2e65d5990239318f49a32b7a (patch)
tree059e9b1ca7c2c4b3a51cb6dac9e0f557daffdbd2 /sugar/emulator.py
parentdade0b6931812526b24b9f80e00181e412773967 (diff)
Try harder to support wide screen
Diffstat (limited to 'sugar/emulator.py')
-rw-r--r--sugar/emulator.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/sugar/emulator.py b/sugar/emulator.py
index fe9539d..6cc4f52 100644
--- a/sugar/emulator.py
+++ b/sugar/emulator.py
@@ -78,13 +78,16 @@ class MatchboxProcess(Process):
return 'Matchbox'
class XephyrProcess(Process):
- def __init__(self, fullscreen):
+ def __init__(self, width, height, fullscreen):
self._display = get_display_number()
cmd = 'Xephyr :%d -ac ' % (self._display)
+
if fullscreen:
- cmd += '-fullscreen '
- else:
- cmd += '-screen 1200x900'
+ cmd += ' -fullscreen '
+
+ if width > 0 and height > 0:
+ cmd += ' -screen %dx%d' % (width, height)
+
Process.__init__(self, cmd)
def get_name(self):
@@ -97,12 +100,15 @@ class XephyrProcess(Process):
class Emulator(object):
"""The OLPC emulator"""
- def __init__(self, fullscreen):
+ def __init__(self, width, height, fullscreen):
self._fullscreen = fullscreen
+ self._width = width
+ self._height = height
def start(self):
try:
- process = XephyrProcess(self._fullscreen)
+ process = XephyrProcess(self._width, self._height,
+ self._fullscreen)
process.start()
except:
print 'Cannot run the emulator. You need to install Xephyr'