Attachments you submit will be routed for moderation. If you have an account, please log in first.

Ticket #1747: 0001-Minor-sugar-emulator-tweaks-1747.patch

File 0001-Minor-sugar-emulator-tweaks-1747.patch, 2.8 KB (added by alsroot, 3 years ago)

Actualize patch to 0.90

  • src/jarabe/util/emulator.py

    From 53a7f1f621439aa66345584d99235e1294656b97 Mon Sep 17 00:00:00 2001
    From: Aleksey Lim <alsroot@member.fsf.org>
    Date: Fri, 17 Sep 2010 13:22:20 +0000
    Subject: [PATCH] Default sugar-emulator window size does not follow HIG #1747
    
    ---
     src/jarabe/util/emulator.py |   16 +++++++++-------
     1 files changed, 9 insertions(+), 7 deletions(-)
    
    diff --git a/src/jarabe/util/emulator.py b/src/jarabe/util/emulator.py
    index 6a43044..e6455a0 100644
    a b  
    3232ERROR_NO_SERVER = 31 
    3333 
    3434 
    35 default_dimensions = (800, 600) 
    3635def _run_xephyr(display, dpi, dimensions, fullscreen): 
    3736    cmd = [ 'Xephyr' ] 
    3837    cmd.append(':%d' % display) 
    3938    cmd.append('-ac')  
    4039    cmd += ['-title', _('Sugar in a window')] 
    4140 
     41    from sugar.graphics.style import GRID_CELL_SIZE 
     42    default_dimensions = (GRID_CELL_SIZE * 16, GRID_CELL_SIZE * 12) 
     43 
    4244    screen_size = (gtk.gdk.screen_width(), gtk.gdk.screen_height()) 
    4345 
    4446    if (not dimensions) and (fullscreen is None) and \ 
     
    118120 
    119121    gobject.spawn_async(cmd, flags=gobject.SPAWN_SEARCH_PATH) 
    120122 
    121 def _setup_env(display, scaling, emulator_pid): 
     123def _setup_env(display, emulator_pid): 
    122124    os.environ['SUGAR_EMULATOR'] = 'yes' 
    123125    os.environ['GABBLE_LOGFILE'] = os.path.join( 
    124126            env.get_profile_path(), 'logs', 'telepathy-gabble.log') 
     
    133135    os.environ['MC_ACCOUNT_DIR'] = os.path.join( 
    134136            env.get_profile_path(), 'accounts') 
    135137 
    136     if scaling: 
    137         os.environ['SUGAR_SCALING'] = scaling 
    138  
    139138def main(): 
    140139    """Script-level operations""" 
    141140 
     
    143142    parser.add_option('-d', '--dpi', dest='dpi', type="int", 
    144143                      help='Emulator dpi') 
    145144    parser.add_option('-s', '--scaling', dest='scaling', 
    146                       help='Sugar scaling in %') 
     145                      help='Sugar scaling in %', default='72') 
    147146    parser.add_option('-i', '--dimensions', dest='dimensions', 
    148147                      help='Emulator dimensions (ex. 1200x900)') 
    149148    parser.add_option('-f', '--fullscreen', dest='fullscreen', 
     
    158157        sys.stderr.write('DISPLAY not set, cannot connect to host X server.\n') 
    159158        return ERROR_NO_DISPLAY 
    160159 
     160    # Set SUGAR_SCALING before importing sugar.graphics.style in _run_xephyr 
     161    os.environ['SUGAR_SCALING'] = options.scaling 
     162 
    161163    server, display = _start_xephyr(options.dpi, options.dimensions, 
    162164                                    options.fullscreen) 
    163165    if server is None: 
     
    165167            ' for any error message.\n') 
    166168        return ERROR_NO_SERVER 
    167169 
    168     _setup_env(display, options.scaling, str(server.pid)) 
     170    _setup_env(display, str(server.pid)) 
    169171 
    170172    command = ['dbus-launch', '--exit-with-session'] 
    171173