[BOX32] Initalized libX11 if used without loading (becauseit's loaded indirectly with SDL2 for example)

This commit is contained in:
ptitSeb 2024-10-04 18:18:18 +02:00
parent 088720db22
commit 6ae502f181

View File

@ -1612,8 +1612,17 @@ void convert_Screen_to_32(void* d, void* s)
dst->root_input_mask = to_long(src->root_input_mask);
}
void* my_dlopen(x64emu_t* emu, void *filename, int flag);
void* addDisplay(void* d)
{
if(!my_lib) {
// the lib has not be loaded directly... need to open it! leaking the lib handle...
#ifdef ANDROID
my_dlopen(thread_get_emu(), "libX11.so", RTLD_NOW);
#else
my_dlopen(thread_get_emu(), "libX11.so.6", RTLD_NOW);
#endif
}
my_XDisplay_t* dpy = (my_XDisplay_t*)d;
// look for a free slot, or a display already there
my_XDisplay_32_t* ret = NULL;