aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPo Lu2024-04-15 19:54:20 +0800
committerPo Lu2024-04-15 19:58:03 +0800
commitdeef12c15d8c9444a583fffa9254cc4fc44ebfa3 (patch)
tree51fb08d7d17bde8ffc886f17b1c130b24ec680fc
parent9a79db506e39c02daa81629f0b224a86fad2b3c6 (diff)
downloademacs-deef12c15d8c9444a583fffa9254cc4fc44ebfa3.tar.gz
emacs-deef12c15d8c9444a583fffa9254cc4fc44ebfa3.zip
Rewrite Android description of Android window management
* doc/emacs/android.texi (Android Environment): Rewrite several paragraphs to better reflect recent changes and emphasize behavior on modern OS releases.
-rw-r--r--doc/emacs/android.texi120
1 files changed, 62 insertions, 58 deletions
diff --git a/doc/emacs/android.texi b/doc/emacs/android.texi
index 3f784bc9637..15c5fbcce3a 100644
--- a/doc/emacs/android.texi
+++ b/doc/emacs/android.texi
@@ -823,69 +823,73 @@ example, the permission to access contacts may be useful for EUDC.
823@node Android Windowing 823@node Android Windowing
824@section The Android Window System 824@section The Android Window System
825 825
826 Android's window system is unusual, in that all windows are 826 Android's window system is unusual in that all windows are reported to
827maximized or full-screen, and only one window can be displayed at a 827applications as maximized or full-screen, and, in the general case, only
828time. On larger devices, the system permits simultaneously tiling up 828one window can be displayed at a time. On larger devices, the system
829to four windows on the screen. 829permits simultaneously tiling up to four windows on the screen, though
830 830in emulators or installations configured for ``desktop'' system stacks
831 Windows on Android do not exist indefinitely after they are created. 831freely resizable windows as other desktop window managers do.
832Instead, the system may choose to close windows that are not on screen 832
833in order to conserve memory, with the assumption that the program will 833 Windows, or, in system nomenclature, activities, do not exist
834save its contents to disk and restore them later, when the user asks 834indefinitely after creation, as the system may choose to pause windows
835for it to be opened again. As this is obviously not possible with 835that are not visible in order to conserve memory, on the assumption that
836Emacs, Emacs separates the resources associated with a frame from its 836the program will save its contents to disk, to be restored when the user
837system window. 837selects those windows from the task switcher. Furthermore, a window is
838 838created by the operating system at Emacs startup that is afforded
839 Each system window created (including the initial window created 839special treatment, which Emacs is expected to adopt.
840during Emacs startup) is appended to a list of windows that do not 840
841have associated frames. When a frame is created, Emacs looks up any 841 Emacs approaches window management with the general objective of
842window within that list, and displays the contents of the frame 842minimizing differences in frame behavior exposed to Lisp from that of
843within; if there is no window at all, then one is created. Likewise, 843frames on ordinary window systems, such as X Windows; the degree to
844when a new window is created by the system, Emacs places the contents 844which this goal is actually attained varies by the availability of
845of any frame that is not already displayed within a window inside. 845facilities for window management in the version of Android where it is
846When a frame is closed, the corresponding system window is also 846installed, and operating system policy towards inactive windows. When
847closed. Upon startup, the system creates a window itself (within 847it is unavoidable that concessions should be made to such policy, Emacs
848which Emacs displays the first window system frame shortly 848prefers destroying frames to retaining ones with no activities to
849thereafter.) Emacs differentiates between that window and windows 849display them, unless such a frame is the initial frame and therefore
850created on behalf of other frames to determine what to do when the 850displayed in the activity created at startup, which it is possible to
851system window associated with a frame is closed: 851open and identify so long as Emacs is yet executing.
852
853@cindex frames and windows, Android 5.0
854 Android 5.0 and later support an accurate implementation of window
855management where frames hold a one-to-one relation to the activities in
856which they are displayed, enabling deletion of activities in the task
857switcher to directly affect the frames concerned, and vice versa. There
858are just two exceptions:
852 859
853@itemize @bullet 860@itemize @bullet
854@item 861@item
855When the system closes the window created during application startup 862After the system pauses an activity that remains in the task switcher in
856in order to save memory, Emacs retains the frame for when that window 863response to inactivity, removing it from the task switcher while it
857is created later. 864remains in its inactive state will not delete the frame inside, as Emacs
858 865is not notified of the deletion of its activities in such circumstances.
859@item 866The frame will be deleted upon the next window management operation that
860When the user closes the window created during application startup, 867prompts an examination of the list of live windows. Likewise, an
861and the window was not previously closed by the system in order to 868inactive activity displaying a frame will not be immediately deleted
862save resources, Emacs deletes any frame displayed within that window. 869with its frame, but will be if it is selected from the window list or
863 870upon another examination of the window list.
864However, on Android 7.0 and later, such frames are not deleted if the 871
865window is closed four or more hours after the window moves into the 872@item
866background, as the system automatically removes open windows once a 873Any frame besides the initial frame might be deleted after 4 to 6 hours
867certain period of inactivity elapses when the number of windows retained 874of inactivity in the background, if it is removed by the system in
868by the window manager surpasses a specific threshold, and window 875``trimming'' the task switcher of excess, and presumably unwanted,
869deletion by this mechanism is indistinguishable from window deletion by 876tasks; the initial frame is exempt from this treatment because it can be
870the user. Emacs begins to ignore window deletion after two hours less 877reopened otherwise than from the task switcher, but as deletion by this
871than the default value of this threshold both to err on the side of 878mechanism is indistinguishable from legitimate user action to remove
872caution, in case the system's record of inactivity and Emacs's disagree, 879activities from the task switcher, the latter will also be ignored by
873and for the reason that this threshold is open to customization by OS 880the initial frame after a 4-hour interval elapses from the time of last
874distributors. 881activity.
875
876@item
877When the user or the system closes any window created by Emacs on behalf
878of a specific frame, Emacs deletes the frame displayed within that
879window, unless the system is Android 5.0 or later, where such windows
880are treated identically to the window created at startup, albeit with no
881proviso regarding window inactivity.
882@end itemize 882@end itemize
883 883
884 When the system predates Android 5.0, the window manager will not 884@cindex frames and windows, Android 4.4
885accept more than one user-created Emacs window. If frame creation gives 885@cindex frames and windows, Android 2.2
886rise to windows in excess of this limit, the window manager will 886 Android 4.4 and earlier provide considerably inferior interfaces
887arbitrarily select one of their number to display, with the rest 887inadequate for a complete implementation of window management. On such
888remaining invisible until that window is destroyed with its frame. 888systems, Emacs substitutes a fairly primitive mechanism where all but
889the initial frame are deleted when their activities are paused, only a
890single activity (not counting the activity created at startup) is
891visible at a time, and unattached frames are displayed in the first
892unoccupied activity available.
889 893
890@cindex windowing limitations, android 894@cindex windowing limitations, android
891@cindex frame parameters, android 895@cindex frame parameters, android