Ticket #17: emulator.py.patch

File emulator.py.patch, 974 bytes (added by morgs, 12 years ago)

Patch from Ubuntu ticket - Simon Mungewell

  • .py

    old new  
    1616
    1717import os
    1818import sys
     19import random
    1920import socket
    2021import logging
    2122from optparse import OptionParser
     
    6768
    6869    cmd = [ 'Xephyr' ]
    6970    cmd.append(':%d' % display)
    70     cmd.append('-ac')
    7171
    7272    if gtk.gdk.screen_width() < 1200 or gtk.gdk.screen_height() < 900:
    7373        cmd.append('-fullscreen')
     
    8181        cmd.append('-dpi')
    8282        cmd.append('%d' % dpi)
    8383
     84    random.seed()
     85    cmd2 = [ 'xauth' ]
     86    cmd2.append('add')
     87    cmd2.append(':%d' % display)
     88    cmd2.append('.')
     89    cmd2.append('%s' % hex(random.getrandbits(128))[2:-1])
     90    log.debug('Xauth command: %s', " ".join( cmd2 ))
     91    gobject.spawn_async(cmd2, flags=gobject.SPAWN_SEARCH_PATH)
     92
    8493    log.debug('Xephyr command: %s', " ".join( cmd ))
    8594    result = gobject.spawn_async(cmd, flags=gobject.SPAWN_SEARCH_PATH)
    8695    pid = result[0]