VirtualBox

Changeset 48495 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Sep 16, 2013 3:49:56 PM (11 years ago)
Author:
vboxsync
Message:

FE/Qt: do not call XInitThreads with older libX11 versions.

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk

    r48458 r48495  
    175175# Necessary for the hdd backend enumeration
    176176VirtualBox_LIBS = $(LIB_DDU)
     177
     178if1of ($(KBUILD_TARGET), linux freebsd netbsd openbsd)
     179 VirtualBox_LIBS += dl
     180endif
    177181
    178182# This library is required for multi-monitor support
  • trunk/src/VBox/Frontends/VirtualBox/src/main.cpp

    r48137 r48495  
    4646#ifdef Q_WS_X11
    4747# include <X11/Xlib.h>
     48# include <dlfcn.h>
    4849#endif
    4950
     
    292293}
    293294
     295#ifdef Q_WS_X11
     296/** This is a workaround for a bug on old libX11 versions, fixed in commit
     297 *      941f02ede63baa46f93ed8abccebe76fb29c0789 and released in version 1.1. */
     298Status VBoxXInitThreads(void)
     299{
     300    void *pvProcess = dlopen(NULL, RTLD_GLOBAL | RTLD_LAZY);
     301    Status rc = 1;
     302    if (pvProcess && dlsym(pvProcess, "xcb_connect"))
     303        rc = XInitThreads();
     304    if (pvProcess)
     305        dlclose(pvProcess);
     306    return rc;
     307}
     308#endif
     309
    294310extern "C" DECLEXPORT(int) TrustedMain(int argc, char **argv, char ** /*envp*/)
    295311{
     
    301317
    302318#ifdef Q_WS_X11
    303     if (!XInitThreads())
     319    if (!VBoxXInitThreads())
    304320        return 1;
    305321#endif
     
    543559    bool fInitSUPLib = false;
    544560#ifdef Q_WS_X11
    545     if (!XInitThreads())
     561    if (!VBoxXInitThreads())
    546562        return 1;
    547563#endif
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette