aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2023-03-06 11:25:51 +0800
committerPo Lu2023-03-06 11:25:51 +0800
commit97ca0a855116797779450bfb758ea6c706348df3 (patch)
treeac323afb4eb8a92f55f76d31ea89589de65fda9b /src
parent0dbbdd20f44c7757835a85a30763af18491f6eb1 (diff)
downloademacs-97ca0a855116797779450bfb758ea6c706348df3.tar.gz
emacs-97ca0a855116797779450bfb758ea6c706348df3.zip
Update Android port
* java/org/gnu/emacs/EmacsService.java (sync): Delete function. * java/org/gnu/emacs/EmacsView.java (handleDirtyBitmap): Erase with window background. (onDetachedFromWindow): Only recycle bitmap if non-NULL. * java/org/gnu/emacs/EmacsWindow.java (background): New field. (changeWindowBackground): Set it. * src/android.c (struct android_emacs_service): Remove `sync'. (android_init_emacs_service): Likewise. (android_sync): Delete function. * src/androidfns.c (android_create_tip_frame): Set frame background color correctly. (Fx_show_tip): Make the tip frame visible. * src/androidgui.h: Update prototypes. * src/androidterm.c (handle_one_android_event): Handle tooltip movement correctly.
Diffstat (limited to 'src')
-rw-r--r--src/android.c11
-rw-r--r--src/androidfns.c12
-rw-r--r--src/androidgui.h2
-rw-r--r--src/androidterm.c10
4 files changed, 17 insertions, 18 deletions
diff --git a/src/android.c b/src/android.c
index 656971e154f..9fc4143602c 100644
--- a/src/android.c
+++ b/src/android.c
@@ -104,7 +104,6 @@ struct android_emacs_service
104 jmethodID get_screen_height; 104 jmethodID get_screen_height;
105 jmethodID detect_mouse; 105 jmethodID detect_mouse;
106 jmethodID name_keysym; 106 jmethodID name_keysym;
107 jmethodID sync;
108 jmethodID browse_url; 107 jmethodID browse_url;
109 jmethodID restart_emacs; 108 jmethodID restart_emacs;
110 jmethodID update_ic; 109 jmethodID update_ic;
@@ -2122,7 +2121,6 @@ android_init_emacs_service (void)
2122 FIND_METHOD (get_screen_height, "getScreenHeight", "(Z)I"); 2121 FIND_METHOD (get_screen_height, "getScreenHeight", "(Z)I");
2123 FIND_METHOD (detect_mouse, "detectMouse", "()Z"); 2122 FIND_METHOD (detect_mouse, "detectMouse", "()Z");
2124 FIND_METHOD (name_keysym, "nameKeysym", "(I)Ljava/lang/String;"); 2123 FIND_METHOD (name_keysym, "nameKeysym", "(I)Ljava/lang/String;");
2125 FIND_METHOD (sync, "sync", "()V");
2126 FIND_METHOD (browse_url, "browseUrl", "(Ljava/lang/String;)" 2124 FIND_METHOD (browse_url, "browseUrl", "(Ljava/lang/String;)"
2127 "Ljava/lang/String;"); 2125 "Ljava/lang/String;");
2128 FIND_METHOD (restart_emacs, "restartEmacs", "()V"); 2126 FIND_METHOD (restart_emacs, "restartEmacs", "()V");
@@ -4514,15 +4512,6 @@ android_translate_coordinates (android_window src, int x,
4514 ANDROID_DELETE_LOCAL_REF (coordinates); 4512 ANDROID_DELETE_LOCAL_REF (coordinates);
4515} 4513}
4516 4514
4517void
4518android_sync (void)
4519{
4520 (*android_java_env)->CallVoidMethod (android_java_env,
4521 emacs_service,
4522 service_class.sync);
4523 android_exception_check ();
4524}
4525
4526int 4515int
4527android_wc_lookup_string (android_key_pressed_event *event, 4516android_wc_lookup_string (android_key_pressed_event *event,
4528 wchar_t *buffer_return, int wchars_buffer, 4517 wchar_t *buffer_return, int wchars_buffer,
diff --git a/src/androidfns.c b/src/androidfns.c
index 4837b00a21e..5a23e8bd196 100644
--- a/src/androidfns.c
+++ b/src/androidfns.c
@@ -1883,9 +1883,10 @@ android_create_tip_frame (struct android_display_info *dpyinfo,
1883 unsigned long mask; 1883 unsigned long mask;
1884 1884
1885 block_input (); 1885 block_input ();
1886 mask = ANDROID_CW_OVERRIDE_REDIRECT; 1886 mask = ANDROID_CW_OVERRIDE_REDIRECT | ANDROID_CW_BACK_PIXEL;
1887 1887
1888 attrs.override_redirect = true; 1888 attrs.override_redirect = true;
1889 attrs.background_pixel = FRAME_BACKGROUND_PIXEL (f);
1889 tip_window 1890 tip_window
1890 = FRAME_ANDROID_WINDOW (f) 1891 = FRAME_ANDROID_WINDOW (f)
1891 = android_create_window (FRAME_DISPLAY_INFO (f)->root_window, 1892 = android_create_window (FRAME_DISPLAY_INFO (f)->root_window,
@@ -2314,10 +2315,6 @@ DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0,
2314 android_map_raised (FRAME_ANDROID_WINDOW (tip_f)); 2315 android_map_raised (FRAME_ANDROID_WINDOW (tip_f));
2315 unblock_input (); 2316 unblock_input ();
2316 2317
2317 /* Synchronize with the UI thread. This is required to prevent ugly
2318 black splotches. */
2319 android_sync ();
2320
2321 /* Garbage the tip frame too. */ 2318 /* Garbage the tip frame too. */
2322 SET_FRAME_GARBAGED (tip_f); 2319 SET_FRAME_GARBAGED (tip_f);
2323 2320
@@ -2328,6 +2325,11 @@ DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0,
2328 unbind_to (count_1, Qnil); 2325 unbind_to (count_1, Qnil);
2329 windows_or_buffers_changed = old_windows_or_buffers_changed; 2326 windows_or_buffers_changed = old_windows_or_buffers_changed;
2330 2327
2328 /* MapNotify events are not sent on Android, so make the frame
2329 visible. */
2330
2331 SET_FRAME_VISIBLE (tip_f, true);
2332
2331 start_timer: 2333 start_timer:
2332 /* Let the tip disappear after timeout seconds. */ 2334 /* Let the tip disappear after timeout seconds. */
2333 tip_timer = call3 (Qrun_at_time, timeout, Qnil, 2335 tip_timer = call3 (Qrun_at_time, timeout, Qnil,
diff --git a/src/androidgui.h b/src/androidgui.h
index 84419457a8a..6514c78d289 100644
--- a/src/androidgui.h
+++ b/src/androidgui.h
@@ -606,8 +606,6 @@ extern void android_move_resize_window (android_window, int, int,
606extern void android_map_raised (android_window); 606extern void android_map_raised (android_window);
607extern void android_translate_coordinates (android_window, int, 607extern void android_translate_coordinates (android_window, int,
608 int, int *, int *); 608 int, int *, int *);
609extern void android_sync (void);
610
611extern int android_wc_lookup_string (android_key_pressed_event *, 609extern int android_wc_lookup_string (android_key_pressed_event *,
612 wchar_t *, int, int *, 610 wchar_t *, int, int *,
613 enum android_lookup_status *); 611 enum android_lookup_status *);
diff --git a/src/androidterm.c b/src/androidterm.c
index 814af87819b..a6709ac8169 100644
--- a/src/androidterm.c
+++ b/src/androidterm.c
@@ -676,6 +676,16 @@ handle_one_android_event (struct android_display_info *dpyinfo,
676 if (!f) 676 if (!f)
677 goto OTHER; 677 goto OTHER;
678 678
679 if (FRAME_TOOLTIP_P (f))
680 {
681 if (FRAME_PIXEL_HEIGHT (f) != configureEvent.xconfigure.height
682 || FRAME_PIXEL_WIDTH (f) != configureEvent.xconfigure.width)
683 SET_FRAME_GARBAGED (f);
684
685 FRAME_PIXEL_HEIGHT (f) = configureEvent.xconfigure.height;
686 FRAME_PIXEL_WIDTH (f) = configureEvent.xconfigure.width;
687 }
688
679 int width = configureEvent.xconfigure.width; 689 int width = configureEvent.xconfigure.width;
680 int height = configureEvent.xconfigure.height; 690 int height = configureEvent.xconfigure.height;
681 691