summaryrefslogtreecommitdiff
path: root/src/androidfns.c
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2024-01-26 11:24:51 +0800
committerPo Lu <luangruo@yahoo.com>2024-01-26 11:24:51 +0800
commit16831e290ed29f5f70dfe144ec63c583527485e8 (patch)
treeeecc1f3de356aa04a82f4687d7dac4303282ea77 /src/androidfns.c
parent65829b27ca4898ff0905a8124980243977a1382f (diff)
downloademacs-16831e290ed29f5f70dfe144ec63c583527485e8.tar.gz
Avert race condition between window attachment and buffer swap
* java/org/gnu/emacs/EmacsView.java (swapBuffers): Synchronize such that code cannot execute between the bitmap's being loaded and being transferred to surfaceView. (onDetachedFromWindow): Recycle bitmap after the surface view is reset. * java/org/gnu/emacs/EmacsWindow.java (recreateActivity): * src/android.c (android_init_emacs_window) (android_recreate_activity): * src/androidfns.c (Fandroid_recreate_activity) (syms_of_androidfns): New functions for debugging window attachment. * src/androidgui.h: Update prototypes.
Diffstat (limited to 'src/androidfns.c')
-rw-r--r--src/androidfns.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/androidfns.c b/src/androidfns.c
index 34f1f533684..eaecb78338b 100644
--- a/src/androidfns.c
+++ b/src/androidfns.c
@@ -3164,6 +3164,24 @@ android_set_preeditarea (struct window *w, int x, int y)
y + w->phys_cursor_height);
}
+
+
+/* Debugging. */
+
+DEFUN ("android-recreate-activity", Fandroid_recreate_activity,
+ Sandroid_recreate_activity, 0, 0, "",
+ doc: /* Recreate the activity attached to the current frame.
+This function exists for debugging purposes and is of no interest to
+users. */)
+ (void)
+{
+ struct frame *f;
+
+ f = decode_window_system_frame (Qnil);
+ android_recreate_activity (FRAME_ANDROID_WINDOW (f));
+ return Qnil;
+}
+
#endif /* !ANDROID_STUBIFY */
@@ -3550,6 +3568,7 @@ language to be US English if LANGUAGE is empty. */);
defsubr (&Sandroid_request_directory_access);
defsubr (&Sandroid_external_storage_available_p);
defsubr (&Sandroid_request_storage_access);
+ defsubr (&Sandroid_recreate_activity);
tip_timer = Qnil;
staticpro (&tip_timer);