diff options
| author | Po Lu <luangruo@yahoo.com> | 2024-06-24 12:04:05 +0800 |
|---|---|---|
| committer | Po Lu <luangruo@yahoo.com> | 2024-06-24 12:04:05 +0800 |
| commit | 73a58329a6946f5abc62fee2647efba56cce236b (patch) | |
| tree | 05066d28f294ae960d66b951b4f21d243ce4eccc /java/org/gnu/emacs/EmacsView.java | |
| parent | 0edacf2aa7e53d0cec95bcaae4cd19e5389b70f8 (diff) | |
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/org/gnu/emacs/EmacsView.java')
| -rw-r--r-- | java/org/gnu/emacs/EmacsView.java | 32 |
1 files changed, 16 insertions, 16 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 return canvas; } - public synchronized void - prepareForLayout (int wantedWidth, int wantedHeight) - { - measuredWidth = wantedWidth; - measuredHeight = wantedWidth; - } - @Override protected void onMeasure (int widthMeasureSpec, int heightMeasureSpec) @@ -773,23 +766,30 @@ public final class EmacsView extends ViewGroup /* Collect the bitmap storage; it could be large. */ Runtime.getRuntime ().gc (); - super.onDetachedFromWindow (); } @Override - public synchronized void + public void onAttachedToWindow () { - isAttachedToWindow = true; + synchronized (this) + { + isAttachedToWindow = true; - /* Dirty the bitmap, as it was destroyed when onDetachedFromWindow - was called. */ - bitmapDirty = true; + /* Dirty the bitmap, as it was destroyed when + onDetachedFromWindow was called. */ + bitmapDirty = true; + + /* Rather than unconditionally generating an exposure event upon + window attachment, avoid delivering successive Exposure + events if the size of the window has changed but is still to + be reported by clearing the measured width and height, and + requesting another layout computation. */ + measuredWidth = measuredHeight = 0; + } - /* Now expose the view contents again. */ - EmacsNative.sendExpose (this.window.handle, 0, 0, - measuredWidth, measuredHeight); + requestLayout (); super.onAttachedToWindow (); } |
