Fix remaining Android bugs reported over the past months
* java/org/gnu/emacs/EmacsActivity.java (attachWindow): Guarantee that child windows promoted to toplevels receive layout parameters that direct them to receive their parents' dimensions. Otherwise, the size of the window as a child is retained on Huawei HarmonyOS 4.2 and possibly other Android distributions. * java/org/gnu/emacs/EmacsService.java (updateCursorAnchorInfo): Run anchor updates on the UI thread, as `InputMethodManager#updateCursorAnchorInfo' is liable to call `View#requestLayout'. * java/org/gnu/emacs/EmacsView.java (onMeasure): Always call `measureChildren', or child frames' onLayout handlers might not be invoked after they request a layout cycle and are duly processed in `onLayout'. (swapBuffers): Delete erroneous commentary. * java/org/gnu/emacs/EmacsWindow.java (viewLayout): If overrideRedirect, don't inadvertently clear rect.left and rect.top by recording the window's WM window-relative position. Fix typos. (reparentTo): Invalidate focus after transferring frame. (translateCoordinates): Account for override-redirect windows. Mostly important for mouse-drag-and-drop-region.
This commit is contained in:
@@ -296,6 +296,9 @@ public final class EmacsView extends ViewGroup
|
||||
&& height > MeasureSpec.getSize (heightMeasureSpec))
|
||||
height = MeasureSpec.getSize (heightMeasureSpec);
|
||||
|
||||
/* This is strictly necessary to propagate layout requests to
|
||||
children. */
|
||||
this.measureChildren (widthMeasureSpec, heightMeasureSpec);
|
||||
super.setMeasuredDimension (width, height);
|
||||
}
|
||||
|
||||
@@ -467,9 +470,6 @@ public final class EmacsView extends ViewGroup
|
||||
}
|
||||
}
|
||||
|
||||
/* This method is called from both the UI thread and the Emacs
|
||||
thread. */
|
||||
|
||||
public void
|
||||
swapBuffers ()
|
||||
{
|
||||
@@ -620,8 +620,7 @@ public final class EmacsView extends ViewGroup
|
||||
detachViewFromParent (index);
|
||||
|
||||
/* The view at 0 is the surface view. */
|
||||
attachViewToParent (child, 1,
|
||||
child.getLayoutParams ());
|
||||
attachViewToParent (child, 1, child.getLayoutParams ());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user