From 6ae502f181f161691f43fd1a08ea0b558f3b322d Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Fri, 4 Oct 2024 18:18:18 +0200 Subject: [PATCH] [BOX32] Initalized libX11 if used without loading (becauseit's loaded indirectly with SDL2 for example) --- src/wrapped32/wrappedlibx11.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/wrapped32/wrappedlibx11.c b/src/wrapped32/wrappedlibx11.c index 139d19c5..10caa3cc 100644 --- a/src/wrapped32/wrappedlibx11.c +++ b/src/wrapped32/wrappedlibx11.c @@ -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;