diff options
| author | Po Lu | 2023-01-20 19:06:32 +0800 |
|---|---|---|
| committer | Po Lu | 2023-01-20 19:06:32 +0800 |
| commit | d44b60c2f001d57b010f0e9b82f798fbad9a23d6 (patch) | |
| tree | 1ff208bfccd74a3b2ad4488cd66c89762d0acd7e /src/androidterm.c | |
| parent | e07b58dc35a66b5e611f437ec007292d82dc8f13 (diff) | |
| download | emacs-d44b60c2f001d57b010f0e9b82f798fbad9a23d6.tar.gz emacs-d44b60c2f001d57b010f0e9b82f798fbad9a23d6.zip | |
Update Android port
* .gitignore: Don't ignore verbose.mk.android.
* doc/emacs/Makefile.in (EMACSSOURCES): Add android.texi and
input.texi.
* doc/emacs/android.texi (Android): Document support for the
on-screen keyboard.
(Android Startup): Document how to start Emacs with -Q on
Android.
(Android Environment): Document how Emacs works around the
system ``task killer''. Document changes to frame deletion
behavior.
* doc/emacs/emacs.texi (Top):
* doc/emacs/input.texi (Other Input Devices, On-Screen
Keyboards): Document how to use Emacs with virtual keyboards.
* doc/lispref/commands.texi (Touchscreen Events): Document
changes to `touch-screen-track-drag'.
* doc/lispref/frames.texi (Frames, On-Screen Keyboards): New
node.
* java/AndroidManifest.xml.in: Add settings activity and
appropriate OSK adjustment mode.
* java/org/gnu/emacs/EmacsActivity.java (onCreate): Allow
creating Emacs with -Q.
(onDestroy): Don't remove if killed by the system.
* java/org/gnu/emacs/EmacsContextMenu.java (inflateMenuItems):
Fix context menus again.
* java/org/gnu/emacs/EmacsNative.java (EmacsNative): Make all
event sending functions return long.
* java/org/gnu/emacs/EmacsPreferencesActivity.java
(EmacsPreferencesActivity): New class.
* java/org/gnu/emacs/EmacsService.java (EmacsService)
(onStartCommand, onCreate, startEmacsService): Start as a
foreground service if necessary to bypass system restrictions.
* java/org/gnu/emacs/EmacsSurfaceView.java (EmacsSurfaceView):
* java/org/gnu/emacs/EmacsThread.java (EmacsThread, run):
* java/org/gnu/emacs/EmacsView.java (EmacsView, onLayout)
(onDetachedFromWindow):
* java/org/gnu/emacs/EmacsWindow.java (EmacsWindow, viewLayout):
Implement frame resize synchronization..
* java/org/gnu/emacs/EmacsWindowAttachmentManager.java
(EmacsWindowAttachmentManager, removeWindowConsumer): Adjust
accordingly for changes to frame deletion behavior.
* lisp/frame.el (android-toggle-on-screen-keyboard)
(frame-toggle-on-screen-keyboard): New function.
* lisp/minibuffer.el (minibuffer-setup-on-screen-keyboard)
(minibuffer-exit-on-screen-keyboard): New functions.
(minibuffer-setup-hook, minibuffer-exit-hook): Add new functions
to hooks.
* lisp/touch-screen.el (touch-screen-relative-xy): Accept new
value of window `frame'. Return frame coordinates in that case.
(touch-screen-set-point-commands): New variable.
(touch-screen-handle-point-up): Respect that variable.
(touch-screen-track-drag): Return `no-drag' where appropriate.
(touch-screen-drag-mode-line-1, touch-screen-drag-mode-line):
Refactor to use `no-drag'.
* src/android.c (struct android_emacs_window): New methods.
Make all event sending functions return the event serial.
(android_toggle_on_screen_keyboard, android_window_updated): New
functions.
* src/android.h: Update prototypes.
* src/androidfns.c (Fandroid_toggle_on_screen_keyboard)
(syms_of_androidfns): New function.
* src/androidgui.h (struct android_any_event)
(struct android_key_event, struct android_configure_event)
(struct android_focus_event, struct android_window_action_event)
(struct android_crossing_event, struct android_motion_event)
(struct android_button_event, struct android_touch_event)
(struct android_wheel_event, struct android_iconify_event)
(struct android_menu_event): Add `serial' fields.
* src/androidterm.c (handle_one_android_event)
(android_frame_up_to_date):
* src/androidterm.h (struct android_output): Implement frame
resize synchronization.
Diffstat (limited to 'src/androidterm.c')
| -rw-r--r-- | src/androidterm.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/androidterm.c b/src/androidterm.c index 3c16b542d91..3024890d789 100644 --- a/src/androidterm.c +++ b/src/androidterm.c | |||
| @@ -591,7 +591,17 @@ handle_one_android_event (struct android_display_info *dpyinfo, | |||
| 591 | android_clear_under_internal_border (f); | 591 | android_clear_under_internal_border (f); |
| 592 | SET_FRAME_GARBAGED (f); | 592 | SET_FRAME_GARBAGED (f); |
| 593 | cancel_mouse_face (f); | 593 | cancel_mouse_face (f); |
| 594 | |||
| 595 | /* Now stash the serial of this configure event somewhere, | ||
| 596 | and call android_window_updated with it once the redraw | ||
| 597 | completes. */ | ||
| 598 | FRAME_OUTPUT_DATA (f)->last_configure_serial | ||
| 599 | = configureEvent.xconfigure.serial; | ||
| 594 | } | 600 | } |
| 601 | else | ||
| 602 | /* Reply to this ConfigureNotify event immediately. */ | ||
| 603 | android_window_updated (FRAME_ANDROID_WINDOW (f), | ||
| 604 | configureEvent.xconfigure.serial); | ||
| 595 | 605 | ||
| 596 | goto OTHER; | 606 | goto OTHER; |
| 597 | 607 | ||
| @@ -1194,6 +1204,9 @@ handle_one_android_event (struct android_display_info *dpyinfo, | |||
| 1194 | /* Iconification. This is vastly simpler than on X. */ | 1204 | /* Iconification. This is vastly simpler than on X. */ |
| 1195 | case ANDROID_ICONIFIED: | 1205 | case ANDROID_ICONIFIED: |
| 1196 | 1206 | ||
| 1207 | if (!any) | ||
| 1208 | goto OTHER; | ||
| 1209 | |||
| 1197 | if (FRAME_ICONIFIED_P (any)) | 1210 | if (FRAME_ICONIFIED_P (any)) |
| 1198 | goto OTHER; | 1211 | goto OTHER; |
| 1199 | 1212 | ||
| @@ -1206,6 +1219,9 @@ handle_one_android_event (struct android_display_info *dpyinfo, | |||
| 1206 | 1219 | ||
| 1207 | case ANDROID_DEICONIFIED: | 1220 | case ANDROID_DEICONIFIED: |
| 1208 | 1221 | ||
| 1222 | if (!any) | ||
| 1223 | goto OTHER; | ||
| 1224 | |||
| 1209 | if (!FRAME_ICONIFIED_P (any)) | 1225 | if (!FRAME_ICONIFIED_P (any)) |
| 1210 | goto OTHER; | 1226 | goto OTHER; |
| 1211 | 1227 | ||
| @@ -1311,6 +1327,14 @@ android_frame_up_to_date (struct frame *f) | |||
| 1311 | /* The frame is now complete, as its contents have been drawn. */ | 1327 | /* The frame is now complete, as its contents have been drawn. */ |
| 1312 | FRAME_ANDROID_COMPLETE_P (f) = true; | 1328 | FRAME_ANDROID_COMPLETE_P (f) = true; |
| 1313 | 1329 | ||
| 1330 | /* If there was an outstanding configure event, then tell system | ||
| 1331 | that the update has finished and the new contents can now be | ||
| 1332 | displayed. */ | ||
| 1333 | if (FRAME_OUTPUT_DATA (f)->last_configure_serial) | ||
| 1334 | android_window_updated (FRAME_ANDROID_WINDOW (f), | ||
| 1335 | FRAME_OUTPUT_DATA (f)->last_configure_serial); | ||
| 1336 | FRAME_OUTPUT_DATA (f)->last_configure_serial = 0; | ||
| 1337 | |||
| 1314 | /* Shrink the scanline buffer used by the font backend. */ | 1338 | /* Shrink the scanline buffer used by the font backend. */ |
| 1315 | sfntfont_android_shrink_scanline_buffer (); | 1339 | sfntfont_android_shrink_scanline_buffer (); |
| 1316 | unblock_input (); | 1340 | unblock_input (); |