Use fullscreen if the screen is not big enough to do a 1200x900 window.
The logic might need tweaking.
This commit is contained in:
parent
31ce0dbf69
commit
0584ac7529
3
README
3
README
@ -28,5 +28,6 @@ Alt+r Rotate the screen
|
|||||||
Alt+o Toggle overlay visibility
|
Alt+o Toggle overlay visibility
|
||||||
Alt+= Open the developer console
|
Alt+= Open the developer console
|
||||||
Alt+0 Open the developer console
|
Alt+0 Open the developer console
|
||||||
|
Alt+q Quit the emulator
|
||||||
|
|
||||||
Ctrl+S Activate sketch mode in chat
|
Ctrl+s Activate sketch mode in chat
|
||||||
|
@ -19,6 +19,8 @@
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
import gtk
|
||||||
|
|
||||||
os.environ['SUGAR_EMULATOR'] = 'yes'
|
os.environ['SUGAR_EMULATOR'] = 'yes'
|
||||||
|
|
||||||
sourcedir = os.path.abspath(os.path.dirname(__file__))
|
sourcedir = os.path.abspath(os.path.dirname(__file__))
|
||||||
@ -31,6 +33,7 @@ else:
|
|||||||
|
|
||||||
from sugar import env
|
from sugar import env
|
||||||
from sugar import util
|
from sugar import util
|
||||||
|
from sugar.emulator import Emulator
|
||||||
|
|
||||||
if sourcedir:
|
if sourcedir:
|
||||||
if os.environ.has_key('PYTHONPATH'):
|
if os.environ.has_key('PYTHONPATH'):
|
||||||
@ -70,16 +73,13 @@ if sourcedir:
|
|||||||
util.write_service('org.laptop.sugar.Console', bin,
|
util.write_service('org.laptop.sugar.Console', bin,
|
||||||
env.get_user_service_dir())
|
env.get_user_service_dir())
|
||||||
|
|
||||||
from sugar.emulator import Emulator
|
if len(sys.argv) == 1:
|
||||||
|
|
||||||
program = 'sugar-shell'
|
program = 'sugar-shell'
|
||||||
|
|
||||||
fullscreen = False
|
|
||||||
for i in range(1, len(sys.argv)):
|
|
||||||
if sys.argv[i] == '-fullscreen':
|
|
||||||
fullscreen = True
|
|
||||||
else:
|
else:
|
||||||
program = sys.argv[i]
|
program = sys.argv[1]
|
||||||
|
|
||||||
|
fullscreen = (gtk.gdk.screen_width() <= 1200 and
|
||||||
|
gtk.gdk.screen_height() <= 900)
|
||||||
|
|
||||||
emulator = Emulator(fullscreen)
|
emulator = Emulator(fullscreen)
|
||||||
emulator.start()
|
emulator.start()
|
||||||
|
@ -84,7 +84,7 @@ class XephyrProcess(Process):
|
|||||||
if fullscreen:
|
if fullscreen:
|
||||||
cmd += '-fullscreen '
|
cmd += '-fullscreen '
|
||||||
else:
|
else:
|
||||||
cmd += '-screen 800x600 '
|
cmd += '-screen 1200x900'
|
||||||
Process.__init__(self, cmd)
|
Process.__init__(self, cmd)
|
||||||
|
|
||||||
def get_name(self):
|
def get_name(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user