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

Update Android port

* java/org/gnu/emacs/EmacsActivity.java (attachWindow, onDestroy)
(onWindowFocusChanged, onContextMenuClosed):

* java/org/gnu/emacs/EmacsContextMenu.java (onMenuItemClick):

* java/org/gnu/emacs/EmacsDialog.java (onClick, display1, onDismiss):

* java/org/gnu/emacs/EmacsOpenActivity.java (checkReadableOrCopy)
(onDestroy, onWindowFocusChanged, onPause):

* java/org/gnu/emacs/EmacsWindowAttachmentManager.java
(registerWindow, removeWindowConsumer, detachWindow)
(noticeIconified, noticeDeiconified): Remove superfluous
debugging code now that the Android port is stable.

* java/org/gnu/emacs/EmacsView.java (onLayout): Detect if the
IME is hidden while a toplevel window is focused, and clear
isCurrentlyTextEditor in that case.
(onApplyWindowInsets): New function.
(raise, lower, popupMenu, onCreateInputConnection): Delete
aforementioned debugging code.
This commit is contained in:
Po Lu 2023-08-28 13:08:22 +08:00
parent 967fa846fc
commit 2134fd9f27
6 changed files with 79 additions and 76 deletions

View file

@ -87,21 +87,17 @@ public final class EmacsWindowAttachmentManager
public void
registerWindowConsumer (WindowConsumer consumer)
{
Log.d (TAG, "registerWindowConsumer " + consumer);
consumers.add (consumer);
for (EmacsWindow window : windows)
{
if (window.getAttachedConsumer () == null)
{
Log.d (TAG, "registerWindowConsumer: attaching " + window);
consumer.attachWindow (window);
return;
}
}
Log.d (TAG, "registerWindowConsumer: sendWindowAction 0, 0");
EmacsNative.sendWindowAction ((short) 0, 0);
}
@ -111,21 +107,16 @@ public final class EmacsWindowAttachmentManager
Intent intent;
ActivityOptions options;
Log.d (TAG, "registerWindow (maybe): " + window);
if (windows.contains (window))
/* The window is already registered. */
return;
Log.d (TAG, "registerWindow: " + window);
windows.add (window);
for (WindowConsumer consumer : consumers)
{
if (consumer.getAttachedWindow () == null)
{
Log.d (TAG, "registerWindow: attaching " + consumer);
consumer.attachWindow (window);
return;
}
@ -147,8 +138,6 @@ public final class EmacsWindowAttachmentManager
EmacsService.SERVICE.startActivity (intent,
options.toBundle ());
}
Log.d (TAG, "registerWindow: startActivity");
}
public void
@ -156,19 +145,14 @@ public final class EmacsWindowAttachmentManager
{
EmacsWindow window;
Log.d (TAG, "removeWindowConsumer " + consumer);
window = consumer.getAttachedWindow ();
if (window != null)
{
Log.d (TAG, "removeWindowConsumer: detaching " + window);
consumer.detachWindow ();
window.onActivityDetached (isFinishing);
}
Log.d (TAG, "removeWindowConsumer: removing " + consumer);
consumers.remove (consumer);
}
@ -177,14 +161,10 @@ public final class EmacsWindowAttachmentManager
{
WindowConsumer consumer;
Log.d (TAG, "detachWindow " + window);
if (window.getAttachedConsumer () != null)
{
consumer = window.getAttachedConsumer ();
Log.d (TAG, "detachWindow: removing" + consumer);
consumers.remove (consumer);
consumer.destroy ();
}
@ -197,8 +177,6 @@ public final class EmacsWindowAttachmentManager
{
EmacsWindow window;
Log.d (TAG, "noticeIconified " + consumer);
/* If a window is attached, send the appropriate iconification
events. */
window = consumer.getAttachedWindow ();
@ -212,8 +190,6 @@ public final class EmacsWindowAttachmentManager
{
EmacsWindow window;
Log.d (TAG, "noticeDeiconified " + consumer);
/* If a window is attached, send the appropriate iconification
events. */
window = consumer.getAttachedWindow ();