]> git.eshelyaron.com Git - emacs.git/commit
Better align Emacs window management with Android task lifecycles
authorPo Lu <luangruo@yahoo.com>
Wed, 3 Apr 2024 12:29:10 +0000 (20:29 +0800)
committerEshel Yaron <me@eshelyaron.com>
Thu, 4 Apr 2024 11:39:11 +0000 (13:39 +0200)
commit0cf932e3efe6418efb3ae0893d4ac001790c978c
treeaf6d411eab2ae8fc408614087ad08e6970676a4f
parentb9bd946db36f159ad6914b0537b4235b82fd72d3
Better align Emacs window management with Android task lifecycles

* java/org/gnu/emacs/EmacsActivity.java (onCreate): Permit
overriding by child classes.
(onDestroy): Minor stylistic adjustments.
(getAttachmentToken): New function.

* java/org/gnu/emacs/EmacsMultitaskActivity.java (onCreate)
(getAttachmentToken): New functions.

* java/org/gnu/emacs/EmacsWindow.java (EmacsWindow):
<attachmentToken, preserve, previouslyAttached>: New variables.
(onActivityDetached): Remove redundant isFinishing argument.
(reparentTo): Reset the foregoing fields before registering with
the window manager.

* java/org/gnu/emacs/EmacsWindowManager.java
(EmacsWindowManager): Rename from EmacsWindowAttachmentManager.
(WindowConsumer): New function getAttachmentToken.
(isWindowEligible): New function.
(registerWindowConsumer, registerWindow, removeWindowConsumer)
(detachWindow): Implement a new window management strategy on
API 29 and subsequent releases where both varieties of toplevel
window are permanently, except when reparented, bound to the
activities to which they attach, and Emacs establishes at
strategic junctures whether those activities remain present.
(getTaskToken, pruneWindows): New functions.

(cherry picked from commit 7df66b4762ff51e394b8db03dfffe888bdba0a67)
java/org/gnu/emacs/EmacsActivity.java
java/org/gnu/emacs/EmacsMultitaskActivity.java
java/org/gnu/emacs/EmacsService.java
java/org/gnu/emacs/EmacsView.java
java/org/gnu/emacs/EmacsWindow.java
java/org/gnu/emacs/EmacsWindowAttachmentManager.java [deleted file]
java/org/gnu/emacs/EmacsWindowManager.java [new file with mode: 0644]