aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorPo Lu2023-03-06 11:25:51 +0800
committerPo Lu2023-03-06 11:25:51 +0800
commit97ca0a855116797779450bfb758ea6c706348df3 (patch)
treeac323afb4eb8a92f55f76d31ea89589de65fda9b /java
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 'java')
-rw-r--r--java/org/gnu/emacs/EmacsService.java19
-rw-r--r--java/org/gnu/emacs/EmacsView.java7
-rw-r--r--java/org/gnu/emacs/EmacsWindow.java7
3 files changed, 12 insertions, 21 deletions
diff --git a/java/org/gnu/emacs/EmacsService.java b/java/org/gnu/emacs/EmacsService.java
index d05ebce75dc..f99d7a40067 100644
--- a/java/org/gnu/emacs/EmacsService.java
+++ b/java/org/gnu/emacs/EmacsService.java
@@ -481,25 +481,6 @@ public final class EmacsService extends Service
481 return String.valueOf (keysym); 481 return String.valueOf (keysym);
482 } 482 }
483 483
484 public void
485 sync ()
486 {
487 Runnable runnable;
488
489 runnable = new Runnable () {
490 public void
491 run ()
492 {
493 synchronized (this)
494 {
495 notify ();
496 }
497 }
498 };
499
500 syncRunnable (runnable);
501 }
502
503 484
504 485
505 /* Start the Emacs service if necessary. On Android 26 and up, 486 /* Start the Emacs service if necessary. On Android 26 and up,
diff --git a/java/org/gnu/emacs/EmacsView.java b/java/org/gnu/emacs/EmacsView.java
index aefc79c4fb7..f751eaaa3e4 100644
--- a/java/org/gnu/emacs/EmacsView.java
+++ b/java/org/gnu/emacs/EmacsView.java
@@ -168,7 +168,7 @@ public final class EmacsView extends ViewGroup
168 = Bitmap.createBitmap (measuredWidth, 168 = Bitmap.createBitmap (measuredWidth,
169 measuredHeight, 169 measuredHeight,
170 Bitmap.Config.ARGB_8888); 170 Bitmap.Config.ARGB_8888);
171 bitmap.eraseColor (0xffffffff); 171 bitmap.eraseColor (window.background | 0xff000000);
172 172
173 /* And canvases. */ 173 /* And canvases. */
174 canvas = new Canvas (bitmap); 174 canvas = new Canvas (bitmap);
@@ -507,7 +507,10 @@ public final class EmacsView extends ViewGroup
507 synchronized (this) 507 synchronized (this)
508 { 508 {
509 /* Recycle the bitmap and call GC. */ 509 /* Recycle the bitmap and call GC. */
510 bitmap.recycle (); 510
511 if (bitmap != null)
512 bitmap.recycle ();
513
511 bitmap = null; 514 bitmap = null;
512 canvas = null; 515 canvas = null;
513 surfaceView.setBitmap (null, null); 516 surfaceView.setBitmap (null, null);
diff --git a/java/org/gnu/emacs/EmacsWindow.java b/java/org/gnu/emacs/EmacsWindow.java
index ffc7476f010..9d907d2b481 100644
--- a/java/org/gnu/emacs/EmacsWindow.java
+++ b/java/org/gnu/emacs/EmacsWindow.java
@@ -129,6 +129,10 @@ public final class EmacsWindow extends EmacsHandleObject
129 /* Whether or not this window is fullscreen. */ 129 /* Whether or not this window is fullscreen. */
130 public boolean fullscreen; 130 public boolean fullscreen;
131 131
132 /* The window background pixel. This is used by EmacsView when
133 creating new bitmaps. */
134 public volatile int background;
135
132 public 136 public
133 EmacsWindow (short handle, final EmacsWindow parent, int x, int y, 137 EmacsWindow (short handle, final EmacsWindow parent, int x, int y,
134 int width, int height, boolean overrideRedirect) 138 int width, int height, boolean overrideRedirect)
@@ -183,6 +187,9 @@ public final class EmacsWindow extends EmacsHandleObject
183 /* scratchGC is used as the argument to a FillRectangles req. */ 187 /* scratchGC is used as the argument to a FillRectangles req. */
184 scratchGC.foreground = pixel; 188 scratchGC.foreground = pixel;
185 scratchGC.markDirty (false); 189 scratchGC.markDirty (false);
190
191 /* Make the background known to the view as well. */
192 background = pixel;
186 } 193 }
187 194
188 public Rect 195 public Rect