From 0bd4b7fdab2fdf437c4a759d53dfdc9f667aefb1 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Wed, 8 Feb 2023 22:40:10 +0800 Subject: Update Android port * doc/lispref/frames.texi (On-Screen Keyboards): Describe return value of `frame-toggle-on-screen-keyboard'. * java/org/gnu/emacs/EmacsSurfaceView.java (surfaceChanged) (surfaceCreated, EmacsSurfaceView): Remove unuseful synchronization code. The framework doesn't seem to look at this at all. * java/org/gnu/emacs/EmacsView.java (EmacsView): (onLayout): Lay out the window after children. (swapBuffers): Properly implement `force'. (windowUpdated): Delete function. * lisp/frame.el (frame-toggle-on-screen-keyboard): Return whether or not the on screen keyboard might've been displayed. * lisp/minibuffer.el (minibuffer-on-screen-keyboard-timer): (minibuffer-on-screen-keyboard-displayed): (minibuffer-setup-on-screen-keyboard): (minibuffer-exit-on-screen-keyboard): Improve OSK dismissal when there are consecutive minibuffers. * lisp/touch-screen.el (touch-screen-window-selection-changed): New function. (touch-screen-handle-point-up): Register it as a window selection changed function. * src/android.c (struct android_emacs_window) (android_init_emacs_window): Remove references to `windowUpdated'. (android_window_updated): Delete function. * src/android.h (struct android_output): Remove `last_configure_serial'. * src/androidterm.c (handle_one_android_event) (android_frame_up_to_date): * src/androidterm.h (struct android_output): Remove frame synchronization, as that does not work on Android. --- src/android.c | 21 --------------------- src/android.h | 1 - src/androidterm.c | 18 ------------------ src/androidterm.h | 5 ----- 4 files changed, 45 deletions(-) (limited to 'src') diff --git a/src/android.c b/src/android.c index a0e64471a05..ebd374addbf 100644 --- a/src/android.c +++ b/src/android.c @@ -125,7 +125,6 @@ struct android_emacs_window jclass class; jmethodID swap_buffers; jmethodID toggle_on_screen_keyboard; - jmethodID window_updated; }; /* The API level of the current device. */ @@ -1830,7 +1829,6 @@ android_init_emacs_window (void) FIND_METHOD (swap_buffers, "swapBuffers", "()V"); FIND_METHOD (toggle_on_screen_keyboard, "toggleOnScreenKeyboard", "(Z)V"); - FIND_METHOD (window_updated, "windowUpdated", "(J)V"); #undef FIND_METHOD } @@ -4325,25 +4323,6 @@ android_toggle_on_screen_keyboard (android_window window, bool show) android_exception_check (); } -/* Tell the window system that all configure events sent to WINDOW - have been fully processed, and that it is now okay to display its - new contents. SERIAL is the serial of the last configure event - processed. */ - -void -android_window_updated (android_window window, unsigned long serial) -{ - jobject object; - jmethodID method; - - object = android_resolve_handle (window, ANDROID_HANDLE_WINDOW); - method = window_class.window_updated; - - (*android_java_env)->CallVoidMethod (android_java_env, object, - method, (jlong) serial); - android_exception_check (); -} - /* When calling the system's faccessat, make sure to clear the flag diff --git a/src/android.h b/src/android.h index da5c4379800..9006f5f34c5 100644 --- a/src/android.h +++ b/src/android.h @@ -88,7 +88,6 @@ extern void android_exception_check (void); extern void android_get_keysym_name (int, char *, size_t); extern void android_wait_event (void); extern void android_toggle_on_screen_keyboard (android_window, bool); -extern void android_window_updated (android_window, unsigned long); extern _Noreturn void android_restart_emacs (void); extern int android_get_current_api_level (void); diff --git a/src/androidterm.c b/src/androidterm.c index d5dafe9b0d7..4aee1a90b68 100644 --- a/src/androidterm.c +++ b/src/androidterm.c @@ -591,17 +591,7 @@ handle_one_android_event (struct android_display_info *dpyinfo, android_clear_under_internal_border (f); SET_FRAME_GARBAGED (f); cancel_mouse_face (f); - - /* Now stash the serial of this configure event somewhere, - and call android_window_updated with it once the redraw - completes. */ - FRAME_OUTPUT_DATA (f)->last_configure_serial - = configureEvent.xconfigure.serial; } - else - /* Reply to this ConfigureNotify event immediately. */ - android_window_updated (FRAME_ANDROID_WINDOW (f), - configureEvent.xconfigure.serial); goto OTHER; @@ -1352,14 +1342,6 @@ android_frame_up_to_date (struct frame *f) /* The frame is now complete, as its contents have been drawn. */ FRAME_ANDROID_COMPLETE_P (f) = true; - /* If there was an outstanding configure event, then tell system - that the update has finished and the new contents can now be - displayed. */ - if (FRAME_OUTPUT_DATA (f)->last_configure_serial) - android_window_updated (FRAME_ANDROID_WINDOW (f), - FRAME_OUTPUT_DATA (f)->last_configure_serial); - FRAME_OUTPUT_DATA (f)->last_configure_serial = 0; - /* Shrink the scanline buffer used by the font backend. */ sfntfont_android_shrink_scanline_buffer (); unblock_input (); diff --git a/src/androidterm.h b/src/androidterm.h index 8cc31f1ab57..ac845187a66 100644 --- a/src/androidterm.h +++ b/src/androidterm.h @@ -241,11 +241,6 @@ struct android_output /* List of all tools (either styluses or fingers) pressed onto the frame. */ struct android_touch_point *touch_points; - - /* Event serial of the last ConfigureNotify event received that has - not yet been drawn. This is used to synchronize resize with the - window system. 0 if no such outstanding event exists. */ - unsigned long last_configure_serial; }; enum -- cgit v1.3