xpra icon
Bug tracker and wiki

Ticket #172: 0002-detect-displayfd-flags-by-xorg-version.patch

File 0002-detect-displayfd-flags-by-xorg-version.patch, 2.9 KB (added by Benoit Gschwind, 6 years ago)
  • src/setup.py

    From 33f3ac533b556fd61f6e711d1a8f496a49a0ed75 Mon Sep 17 00:00:00 2001
    From: Benoit Gschwind <gschwind@gnu-log.net>
    Date: Sat, 14 Jun 2014 14:54:19 +0200
    Subject: [PATCH 2/2] detect displayfd flags by xorg version
    
    ---
     src/setup.py | 22 ++++++++++++++++------
     1 file changed, 16 insertions(+), 6 deletions(-)
    
    diff --git a/src/setup.py b/src/setup.py
    index f78f50f..c5d636a 100755
    a b def build_xpra_conf(xvfb, displayfd): 
    639639    f_out.write((f_in.read()) % {'xvfb_command': xvfb, 'has_displayfd': displayfd})
    640640    f_out.close()
    641641    f_in.close()
    642 
     642   
    643643def get_xorg_conf_and_script():
    644644    if not server_ENABLED:
    645645        return "etc/xpra/client-only/xpra.conf", False
    646646
     647    #do live detection
     648    xorg_version = get_xorg_version()
     649
     650    # detect displayfd
     651    if not xorg_version:
     652        has_displayfd = 'no'
     653    elif xorg_version >= [1, 15]:
     654        has_displayfd = 'yes'
     655    else:
     656        has_displayfd = 'no'
     657       
    647658    def Xvfb():
    648         build_xpra_conf("Xvfb +extension Composite -screen 0 3840x2560x24+32 -nolisten tcp -noreset -auth $XAUTHORITY", "no")
     659        build_xpra_conf("Xvfb +extension Composite -screen 0 3840x2560x24+32 -nolisten tcp -noreset -auth $XAUTHORITY", has_displayfd)
    649660        return "etc/xpra/xpra.conf", False
    650661
    651662    if sys.platform.find("bsd")>=0:
    def get_xorg_conf_and_script(): 
    670681                print("Xorg is suid and not readable, Xdummy support unavailable")
    671682                return Xvfb()
    672683            print("%s is suid and readable, using the xpra_Xdummy wrapper" % XORG_BIN)
    673             build_xpra_conf("xpra_Xdummy -dpi 96 -noreset -nolisten tcp +extension GLX +extension RANDR +extension RENDER -logfile ${HOME}/.xpra/Xorg.${DISPLAY}.log -config /etc/xpra/xorg.conf", "no")
     684            build_xpra_conf("xpra_Xdummy -dpi 96 -noreset -nolisten tcp +extension GLX +extension RANDR +extension RENDER -logfile ${HOME}/.xpra/Xorg.${DISPLAY}.log -config /etc/xpra/xorg.conf", has_displayfd)
    674685            return "etc/xpra/xpra.conf", True
    675686        else:
    676687            print("using Xdummy config file")
    677             build_xpra_conf("Xorg -dpi 96 -noreset -nolisten tcp +extension GLX +extension RANDR +extension RENDER -logfile ${HOME}/.xpra/Xorg.${DISPLAY}.log -config /etc/xpra/xorg.conf", "no")
     688            build_xpra_conf("Xorg -dpi 96 -noreset -nolisten tcp +extension GLX +extension RANDR +extension RENDER -logfile ${HOME}/.xpra/Xorg.${DISPLAY}.log -config /etc/xpra/xorg.conf", has_displayfd)
    678689            return "etc/xpra/xpra.conf", False
    679690
    680691    if Xdummy_ENABLED is False:
    def get_xorg_conf_and_script(): 
    699710        e = sys.exc_info()[1]
    700711        print("failed to detect OS release using %s: %s" % (" ".join(cmd), e))
    701712
    702     #do live detection
    703     xorg_version = get_xorg_version()
     713
    704714    if not xorg_version:
    705715        print("Xorg version could not be detected, Xdummy support disabled (using Xvfb as safe default)")
    706716        return Xvfb()