diff options
| author | Po Lu | 2024-06-24 12:04:05 +0800 |
|---|---|---|
| committer | Po Lu | 2024-06-24 12:04:05 +0800 |
| commit | 73a58329a6946f5abc62fee2647efba56cce236b (patch) | |
| tree | 05066d28f294ae960d66b951b4f21d243ce4eccc /java | |
| parent | 0edacf2aa7e53d0cec95bcaae4cd19e5389b70f8 (diff) | |
| download | emacs-73a58329a6946f5abc62fee2647efba56cce236b.tar.gz emacs-73a58329a6946f5abc62fee2647efba56cce236b.zip | |
Fix omission of updates to child frames on Android
* java/org/gnu/emacs/EmacsView.java (onAttachedFromWindow):
Force a layout cycle rather than report exposure immediately.
(prepareForLayout): Delete function.
* java/org/gnu/emacs/EmacsWindow.java (mapWindow): Remove
redundant calls to prepareForLayout.
* src/androidterm.c (handle_one_android_event): Do not swap
buffers when exposure is registered by a frame only partially
updated.
Diffstat (limited to 'java')
| -rw-r--r-- | java/org/gnu/emacs/EmacsView.java | 34 | ||||
| -rw-r--r-- | java/org/gnu/emacs/EmacsWindow.java | 6 |
2 files changed, 17 insertions, 23 deletions
diff --git a/java/org/gnu/emacs/EmacsView.java b/java/org/gnu/emacs/EmacsView.java index 82792c3fcca..1c06d394817 100644 --- a/java/org/gnu/emacs/EmacsView.java +++ b/java/org/gnu/emacs/EmacsView.java | |||
| @@ -267,13 +267,6 @@ public final class EmacsView extends ViewGroup | |||
| 267 | return canvas; | 267 | return canvas; |
| 268 | } | 268 | } |
| 269 | 269 | ||
| 270 | public synchronized void | ||
| 271 | prepareForLayout (int wantedWidth, int wantedHeight) | ||
| 272 | { | ||
| 273 | measuredWidth = wantedWidth; | ||
| 274 | measuredHeight = wantedWidth; | ||
| 275 | } | ||
| 276 | |||
| 277 | @Override | 270 | @Override |
| 278 | protected void | 271 | protected void |
| 279 | onMeasure (int widthMeasureSpec, int heightMeasureSpec) | 272 | onMeasure (int widthMeasureSpec, int heightMeasureSpec) |
| @@ -773,23 +766,30 @@ public final class EmacsView extends ViewGroup | |||
| 773 | 766 | ||
| 774 | /* Collect the bitmap storage; it could be large. */ | 767 | /* Collect the bitmap storage; it could be large. */ |
| 775 | Runtime.getRuntime ().gc (); | 768 | Runtime.getRuntime ().gc (); |
| 776 | |||
| 777 | super.onDetachedFromWindow (); | 769 | super.onDetachedFromWindow (); |
| 778 | } | 770 | } |
| 779 | 771 | ||
| 780 | @Override | 772 | @Override |
| 781 | public synchronized void | 773 | public void |
| 782 | onAttachedToWindow () | 774 | onAttachedToWindow () |
| 783 | { | 775 | { |
| 784 | isAttachedToWindow = true; | 776 | synchronized (this) |
| 785 | 777 | { | |
| 786 | /* Dirty the bitmap, as it was destroyed when onDetachedFromWindow | 778 | isAttachedToWindow = true; |
| 787 | was called. */ | 779 | |
| 788 | bitmapDirty = true; | 780 | /* Dirty the bitmap, as it was destroyed when |
| 781 | onDetachedFromWindow was called. */ | ||
| 782 | bitmapDirty = true; | ||
| 783 | |||
| 784 | /* Rather than unconditionally generating an exposure event upon | ||
| 785 | window attachment, avoid delivering successive Exposure | ||
| 786 | events if the size of the window has changed but is still to | ||
| 787 | be reported by clearing the measured width and height, and | ||
| 788 | requesting another layout computation. */ | ||
| 789 | measuredWidth = measuredHeight = 0; | ||
| 790 | } | ||
| 789 | 791 | ||
| 790 | /* Now expose the view contents again. */ | 792 | requestLayout (); |
| 791 | EmacsNative.sendExpose (this.window.handle, 0, 0, | ||
| 792 | measuredWidth, measuredHeight); | ||
| 793 | super.onAttachedToWindow (); | 793 | super.onAttachedToWindow (); |
| 794 | } | 794 | } |
| 795 | 795 | ||
diff --git a/java/org/gnu/emacs/EmacsWindow.java b/java/org/gnu/emacs/EmacsWindow.java index 342190113b7..0a4d04971e7 100644 --- a/java/org/gnu/emacs/EmacsWindow.java +++ b/java/org/gnu/emacs/EmacsWindow.java | |||
| @@ -492,7 +492,6 @@ public final class EmacsWindow extends EmacsHandleObject | |||
| 492 | /* Attach the view. */ | 492 | /* Attach the view. */ |
| 493 | try | 493 | try |
| 494 | { | 494 | { |
| 495 | view.prepareForLayout (width, height); | ||
| 496 | windowManager.addView (view, params); | 495 | windowManager.addView (view, params); |
| 497 | 496 | ||
| 498 | /* Record the window manager being used in the | 497 | /* Record the window manager being used in the |
| @@ -517,11 +516,6 @@ public final class EmacsWindow extends EmacsHandleObject | |||
| 517 | public void | 516 | public void |
| 518 | run () | 517 | run () |
| 519 | { | 518 | { |
| 520 | /* Prior to mapping the view, set its measuredWidth and | ||
| 521 | measuredHeight to some reasonable value, in order to | ||
| 522 | avoid excessive bitmap dirtying. */ | ||
| 523 | |||
| 524 | view.prepareForLayout (width, height); | ||
| 525 | view.setVisibility (View.VISIBLE); | 519 | view.setVisibility (View.VISIBLE); |
| 526 | 520 | ||
| 527 | if (!getDontFocusOnMap ()) | 521 | if (!getDontFocusOnMap ()) |