From ab2eaffe9186b1d2c1cd8c5db1c8abdd18421c73 Mon Sep 17 00:00:00 2001 From: Mis012 Date: Tue, 7 May 2024 22:25:32 +0200 Subject: [PATCH] main-executable: add ATL_SKIP_NATIVES_EXTRACTION env --- doc/Envs.md | 1 + src/main-executable/main.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/Envs.md b/doc/Envs.md index 41c3e34f..b39c2b7f 100644 --- a/doc/Envs.md +++ b/doc/Envs.md @@ -8,3 +8,4 @@ this is useful for saving screen space on phone screens, as well as working arou `ATL_UGLY_ENABLE_LOCATION=` - if set, apps will be able to get location data using the relevant android APIs. (TODO: use bubblewrap) `UGLY_HACK_FOR_VR` - if set, EGL will use XWayland display on Wayland. This means the app won't be able to draw to it's window, but it will be able to use pbuffers which are not available on wayland. (TODO: just recommend GDK_BACKEND=x11 if pbuffers are needed?) `ATL_FORCE_FULLSCREEN` - if set, will fullscreen the app window on start; this is useful for saving screen space on phone screens, as well as making apps that can't handle arbitrary screen dimensions for some reason happier +`ATL_SKIP_NATIVES_EXTRACTION` - if set, natives will not be extracted automatically; it's already possible to replace a native lib, but removing it entirely will normally result in it getting re-extracted, which may not be what you want diff --git a/src/main-executable/main.c b/src/main-executable/main.c index a8391c19..9b99fe5b 100644 --- a/src/main-executable/main.c +++ b/src/main-executable/main.c @@ -117,6 +117,7 @@ JNIEnv* create_vm(char *api_impl_jar, char *apk_classpath, char *microg_apk, cha void icon_override(GtkWidget *window, GList *icon_list) { GdkSurface *window_surface = gtk_native_get_surface(GTK_NATIVE(window)); + // set app icon as window icon; this is a noop on Wayland because there is currently no way to set a window icon on Wayland gdk_toplevel_set_icon_list(GDK_TOPLEVEL(window_surface), icon_list); } @@ -382,7 +383,8 @@ static void open(GtkApplication *app, GFile** files, gint nfiles, const gchar* h extract_from_apk("assets/", "assets/"); /* extract native libraries from apk*/ - extract_from_apk("lib/" NATIVE_ARCH "/", "lib/"); + if(!getenv("ATL_SKIP_NATIVES_EXTRACTION")) + extract_from_apk("lib/" NATIVE_ARCH "/", "lib/"); prepare_main_looper(env);