diff --git a/pcsx2/CMakeLists.txt b/pcsx2/CMakeLists.txt index dc3efb50bc..280e17dea7 100644 --- a/pcsx2/CMakeLists.txt +++ b/pcsx2/CMakeLists.txt @@ -662,6 +662,7 @@ set(pcsx2FinalLibs ${ZLIB_LIBRARIES} ${AIO_LIBRARIES} ${GCOV_LIBRARIES} + ${X11_LIBRARIES} ) if(BUILTIN_GS) diff --git a/pcsx2/gui/AppInit.cpp b/pcsx2/gui/AppInit.cpp index 20683f14fc..27ad012b26 100644 --- a/pcsx2/gui/AppInit.cpp +++ b/pcsx2/gui/AppInit.cpp @@ -424,8 +424,20 @@ protected: } }; +#ifdef __unix__ +#include +#endif + bool Pcsx2App::OnInit() { +#ifdef __unix__ + // By default X11 isn't thread safe + // Typically it avoid a crash on Mesa when glthread is enabled on DRI2 + // + // I guess it could be removed once we migrate to Wayland (post 2020) + XInitThreads(); +#endif + EnableAllLogging(); Console.WriteLn("Interface is initializing. Entering Pcsx2App::OnInit!");