Skip to content

Commit

Permalink
[BOX32] Initalized libX11 if used without loading (becauseit's loaded…
Browse files Browse the repository at this point in the history
… indirectly with SDL2 for example)
  • Loading branch information
ptitSeb committed Oct 4, 2024
1 parent 088720d commit 6ae502f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/wrapped32/wrappedlibx11.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6ae502f

Please sign in to comment.