diff --git a/configure b/configure index edde7b9..296eef9 100755 --- a/configure +++ b/configure @@ -46,6 +46,9 @@ param_set("vulkan-string-helper", 1); param_set("shared", 1); param_set("static", 1); param_set("examples", 1); +if($target eq "Linux") { + param_set("x11", 1); +} if($target eq "Linux") { param_set("wayland", 1); } diff --git a/pl/ostype/Linux.pl b/pl/ostype/Linux.pl index 88adcf8..769c93e 100644 --- a/pl/ostype/Linux.pl +++ b/pl/ostype/Linux.pl @@ -1,8 +1,12 @@ +my @enabled_backends=(); + if (param_get("wayland")) { - use_backend("wayland", "x11"); + push(@enabled_backends,"wayland"); } -else { - use_backend("x11"); +if (param_get("x11")) { + push(@enabled_backends,"x11"); } +use_backend(@enabled_backends); + 1; diff --git a/pl/rules.pl b/pl/rules.pl index cfd708c..c968e28 100644 --- a/pl/rules.pl +++ b/pl/rules.pl @@ -8,13 +8,11 @@ if (param_get("classic-theme")) { if (grep(/^x11$/, @backends)) { add_cflags("-DUSE_X11"); new_object("src/backend/x11.c"); - #add_libs("-lX11"); $gl_libs = "-lGL -lGLU"; if (param_get("xrender")) { add_cflags("-DUSE_XRENDER"); - #add_libs("-lXrender"); } } diff --git a/src/backend/x11.c b/src/backend/x11.c index 1ec43cc..6e67e1b 100644 --- a/src/backend/x11.c +++ b/src/backend/x11.c @@ -2301,10 +2301,16 @@ static void MwLLEndStateChangeImpl(MwLL handle) { static int MwLLX11CallInitImpl(void) { xsymtbl.lib_xlib = MwDynamicOpen("libX11.so"); + if(!xsymtbl.lib_xlib) { + return 1; + } #if USE_XRENDER xsymtbl.lib_xrender = MwDynamicOpen("libXrender.so"); #endif + if(!xsymtbl.lib_xrender) { + return 1; + } #define X11_FUNC_LOAD(x) x = MwDynamicSymbol(xsymtbl.lib_xlib, #x) diff --git a/src/core.c b/src/core.c index 98e9955..87a0fee 100644 --- a/src/core.c +++ b/src/core.c @@ -794,6 +794,21 @@ int MwLibraryInit(void) { if(calls[i]() == 0) return 0; } + printf("[WARNING] No suitable GUI backend found! Enabled:" +#ifdef USE_COCOA + " Cocoa" +#endif +#ifdef USE_WAYLAND + " Wayland" +#endif +#ifdef USE_X11 + " X11" +#endif +#ifdef USE_GDI + " GDI" +#endif + "\n"); + return 1; }