You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
main.c: window size needs to be set before calling set_up_handle_cache()
the Context class init creates a static DisplayMetric
This commit is contained in:
@@ -307,6 +307,10 @@ static void open(GtkApplication *app, GFile** files, gint nfiles, const gchar* h
|
|||||||
|
|
||||||
free(app_lib_dir);
|
free(app_lib_dir);
|
||||||
|
|
||||||
|
jclass display_class = (*env)->FindClass(env, "android/view/Display");
|
||||||
|
_SET_STATIC_INT_FIELD(display_class, "window_width", d->window_width);
|
||||||
|
_SET_STATIC_INT_FIELD(display_class, "window_height", d->window_height);
|
||||||
|
|
||||||
set_up_handle_cache(env);
|
set_up_handle_cache(env);
|
||||||
|
|
||||||
/* -- register our JNI library under the appropriate classloader -- */
|
/* -- register our JNI library under the appropriate classloader -- */
|
||||||
@@ -326,10 +330,6 @@ static void open(GtkApplication *app, GFile** files, gint nfiles, const gchar* h
|
|||||||
|
|
||||||
/* -- misc -- */
|
/* -- misc -- */
|
||||||
|
|
||||||
jclass display_class = (*env)->FindClass(env, "android/view/Display");
|
|
||||||
_SET_STATIC_INT_FIELD(display_class, "window_width", d->window_width);
|
|
||||||
_SET_STATIC_INT_FIELD(display_class, "window_height", d->window_height);
|
|
||||||
|
|
||||||
// some apps need the apk path since they directly read their apk
|
// some apps need the apk path since they directly read their apk
|
||||||
jclass context_class = (*env)->FindClass(env, "android/content/Context");
|
jclass context_class = (*env)->FindClass(env, "android/content/Context");
|
||||||
_SET_STATIC_OBJ_FIELD(context_class, "apk_path", "Ljava/lang/String;", _JSTRING(apk_classpath));
|
_SET_STATIC_OBJ_FIELD(context_class, "apk_path", "Ljava/lang/String;", _JSTRING(apk_classpath));
|
||||||
|
|||||||
Reference in New Issue
Block a user