Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar-emulator
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <mpg@redhat.com>2007-01-16 00:21:15 (GMT)
committer Marco Pesenti Gritti <mpg@redhat.com>2007-01-16 00:21:15 (GMT)
commit0584ac7529197e5a9fe34175ebf3d3af80e9f54f (patch)
treeaa0dc78613fbc98bce45c5a6609d465e4906ce6d /sugar-emulator
parent31ce0dbf69fff0cb58e8a3b59791938cd28de197 (diff)
Use fullscreen if the screen is not big enough to do a 1200x900 window.
The logic might need tweaking.
Diffstat (limited to 'sugar-emulator')
-rwxr-xr-xsugar-emulator18
1 files changed, 9 insertions, 9 deletions
diff --git a/sugar-emulator b/sugar-emulator
index 5fd9268..56ee796 100755
--- a/sugar-emulator
+++ b/sugar-emulator
@@ -19,6 +19,8 @@
import os
import sys
+import gtk
+
os.environ['SUGAR_EMULATOR'] = 'yes'
sourcedir = os.path.abspath(os.path.dirname(__file__))
@@ -31,6 +33,7 @@ else:
from sugar import env
from sugar import util
+from sugar.emulator import Emulator
if sourcedir:
if os.environ.has_key('PYTHONPATH'):
@@ -70,16 +73,13 @@ if sourcedir:
util.write_service('org.laptop.sugar.Console', bin,
env.get_user_service_dir())
-from sugar.emulator import Emulator
-
-program = 'sugar-shell'
+if len(sys.argv) == 1:
+ program = 'sugar-shell'
+else:
+ program = sys.argv[1]
-fullscreen = False
-for i in range(1, len(sys.argv)):
- if sys.argv[i] == '-fullscreen':
- fullscreen = True
- else:
- program = sys.argv[i]
+fullscreen = (gtk.gdk.screen_width() <= 1200 and
+ gtk.gdk.screen_height() <= 900)
emulator = Emulator(fullscreen)
emulator.start()