xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.


Ticket #841: xpra-trunk - libfakeXinerama search path.patch

File xpra-trunk - libfakeXinerama search path.patch, 1.6 KB (added by nathan-renniewaldock, 6 years ago)
  • src/xpra/x11/x11_server_base.py

     
    99import gtk.gdk
    1010import gobject
    1111import os.path
     12import sys
    1213
    1314#ensure that we use gtk as display source:
    1415from xpra.x11.gtk_x11 import gdk_display_source
     
    137138        return env
    138139
    139140    def find_fakeXinerama(self):
     141        if sys.platform.startswith("linux"):
     142            libpath = find_lib_ldconfig("fakeXinerama")
     143            if libpath:
     144                return libpath
     145
    140146        return find_lib("libfakeXinerama.so.1")
    141147
    142148
  • src/xpra/os_util.py

     
    172172def force_quit(status=1):
    173173    os._exit(status)
    174174
     175def find_lib_ldconfig(libname):
     176    libname = re.escape(libname)
    175177
     178    map = {"x86_64": "libc6,x86-64"}
     179    arch = map.get(os.uname()[4], "libc6")
     180
     181    pattern = r'^\s+lib%s\.[^\s]+ \(%s(?:,.*?)?\) => (.*lib%s[^\s]+)' % (libname, arch, libname)
     182
     183    try:
     184        p = subprocess.Popen(["ldconfig", "-p"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
     185        data = p.communicate()[0]
     186    except:
     187        log.warn("Failed to launch ldconfig -p")
     188        return None
     189
     190    libpath = re.search(pattern, data, re.MULTILINE)
     191    if libpath:
     192        libpath = libpath.group(1)
     193
     194    return libpath
     195
    176196def find_lib(libname):
    177197    #it would be better to rely on dlopen to find the paths
    178198    #but I cannot find a way of getting ctypes to tell us the path