From: Po Lu Date: Sat, 5 Apr 2025 02:30:30 +0000 (+0800) Subject: Disable desktop-restore-frames by default on Android X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=62ff3782091c3bbddf2b5de503ee893a57d49382;p=emacs.git Disable desktop-restore-frames by default on Android * lisp/desktop.el (desktop-restore-frames): Default to nil when \(featurep 'android). * doc/emacs/misc.texi (Saving Emacs Sessions): Adjust to match. (cherry picked from commit d582ed9dc9be516f17dc9a526c3f9615001a46a6) --- diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index 22de2c3f272..7e9edfce26d 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi @@ -2853,11 +2853,14 @@ can use @kbd{M-x desktop-read} to restore a previously-saved desktop if the current Emacs session didn't load any desktop yet. @vindex desktop-restore-frames - By default, the desktop tries to save and restore the frame and -window configuration. To disable this, set -@code{desktop-restore-frames} to @code{nil}. (See that variable's -documentation for some related options that you can customize to -fine-tune this behavior.) + By default, the desktop tries to save and restore the frame and window +configuration.@footnote{Except on Android, where this option defaults to +@code{nil} because the window manager (@pxref{Android Windowing}) is too +prohibitive to admit of restoring frame configurations.} To disable or +enable this, set @code{desktop-restore-frames} to @code{nil} or any +non-@code{nil} value respectively. (See that variable's documentation +for some related options that you can customize to fine-tune this +behavior.) @vindex frameset-filter-alist When the desktop restores the frame and window configuration, it diff --git a/lisp/desktop.el b/lisp/desktop.el index d1cbc3d7d93..ec5267b7073 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el @@ -423,13 +423,17 @@ host is off-line." :type '(repeat symbol) :group 'desktop) -(defcustom desktop-restore-frames t +(defcustom desktop-restore-frames (not (featurep 'android)) "When non-nil, save and restore the frame and window configuration. See related options `desktop-restore-reuses-frames', -`desktop-restore-in-current-display', and `desktop-restore-forces-onscreen'." +`desktop-restore-in-current-display', and `desktop-restore-forces-onscreen'. + +This option is enabled by default elsewhere than on Android, where it is +disabled by default as programs are too handicapped by the window +manager for frames to be restored." :type 'boolean :group 'desktop - :version "24.4") + :version "31.1") (defcustom desktop-restore-in-current-display t "Controls how restoring of frames treats displays.