1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-18 17:01:01 -08:00

Implement frame restacking under Android

* java/org/gnu/emacs/EmacsActivity.java (invalidateFocus1):
Synchronize with window.children for iteration through it.

* java/org/gnu/emacs/EmacsService.java (queryTree): Synchronize
with windowList for iteration through it.

* java/org/gnu/emacs/EmacsView.java (moveChildToBack): Correct
formatting mistake.
(moveAbove, moveBelow): New functions.

* java/org/gnu/emacs/EmacsWindow.java (destroyHandle, reparentTo)
(raise, lower): Remedy synchronization blunders.
(reconfigure): New function.

* src/android.c (android_init_emacs_window): Link with
`reconfigure'.
(android_reconfigure_wm_window): New wrapper function.

* src/androidfns.c (android_frame_restack): New function.
(Fandroid_frame_restack): Properly implement this function and
expunge outdated comment.

* src/androidgui.h (enum android_stack_mode)
(enum android_window_changes): New enumerators.
This commit is contained in:
Po Lu 2023-10-10 13:11:14 +08:00
parent 238292d657
commit 336c367411
7 changed files with 264 additions and 33 deletions

View file

@ -581,12 +581,12 @@ public final class EmacsView extends ViewGroup
/* The view at 0 is the surface view. */
attachViewToParent (child, 1,
child.getLayoutParams());
child.getLayoutParams ());
}
}
/* The following two functions must not be called if the view has no
parent, or is parented to an activity. */
/* The following four functions must not be called if the view has
no parent, or is parented to an activity. */
public void
raise ()
@ -615,6 +615,40 @@ public final class EmacsView extends ViewGroup
parent.moveChildToBack (this);
}
public void
moveAbove (EmacsView view)
{
EmacsView parent;
int index;
parent = (EmacsView) getParent ();
if (parent != view.getParent ())
throw new IllegalStateException ("Moving view above non-sibling");
index = parent.indexOfChild (this);
parent.detachViewFromParent (index);
index = parent.indexOfChild (view);
parent.attachViewToParent (this, index + 1, getLayoutParams ());
}
public void
moveBelow (EmacsView view)
{
EmacsView parent;
int index;
parent = (EmacsView) getParent ();
if (parent != view.getParent ())
throw new IllegalStateException ("Moving view above non-sibling");
index = parent.indexOfChild (this);
parent.detachViewFromParent (index);
index = parent.indexOfChild (view);
parent.attachViewToParent (this, index, getLayoutParams ());
}
@Override
protected void
onCreateContextMenu (ContextMenu menu)