@@ -29,6 +29,7 @@ final class RuntimeHelper {
2929 private static boolean isLoaded = false ;
3030 private static final String LD_CONFIG = "/etc/ld.so.conf.d/" ;
3131 private static final String LIB_NAME_VERSION = "libappindicator3.so.1" ;
32+ private static final String FLATPAK_LIB_NAME_VERSION = "libappindicator3.so" ;
3233 private static List <String > allPath = new LinkedList <>();
3334 private static final Logger LOG = LoggerFactory .getLogger (RuntimeHelper .class );
3435
@@ -50,14 +51,20 @@ final class RuntimeHelper {
5051 }
5152
5253 allPath .add ("/usr/lib" ); // for systems, that don't implement multiarch
54+ allPath .add ("/app/lib" ); // for flatpak and libraries in the flatpak sandbox
5355 for (String path : allPath ) {
5456 try {
55- System .load (path + File .separator + LIB_NAME_VERSION );
57+ if (!path .equals ("/app/lib" )) {
58+ System .load (path + File .separator + LIB_NAME_VERSION );
59+ } else {
60+ // flatpak has an own, self-compiled version
61+ System .load (path + File .separator + FLATPAK_LIB_NAME_VERSION );
62+ }
5663 isLoaded = true ;
5764 break ;
5865 } catch (UnsatisfiedLinkError ignored ) { }
5966 }
60- LOG .info (isLoaded ? "Native code library " + LIB_NAME_VERSION + " successfully loaded" : "Native code library " + LIB_NAME_VERSION + " failed to load" );
67+ LOG .info (isLoaded ? "Native code library libappindicator3 successfully loaded" : "Native code library libappindicator3 failed to load" );
6168 SymbolLookup loaderLookup = SymbolLookup .loaderLookup ();
6269 SYMBOL_LOOKUP = name -> loaderLookup .find (name ).or (() -> LINKER .defaultLookup ().find (name ));
6370 }
0 commit comments