all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 36894@debbugs.gnu.org
Subject: bug#36894: Restore frameset focus and selectedness
Date: Wed, 14 Aug 2019 00:29:15 +0300	[thread overview]
Message-ID: <87y2zw3gb8.fsf@mail.linkov.net> (raw)
In-Reply-To: <8336i6tolz.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 12 Aug 2019 18:00:56 +0300")

>> Maybe then the desktop should save the selectedness as well.
>
> You mean, restore last-focus-update?  If you add it to
> desktop-globals-to-save, is it restored?

'last-focus-update' is a frame parameter saved in 'desktop-saved-frameset'.

>> > But I asked for a reproducible recipe, and I don't think you have
>> > shown one.  Could you please do that?  I'd like to study it.
>> 
>> In your case above, if you save the frames is such order that
>> the selected frame is not saved last, can you reproduce the problem?
>> I see this problem often when the last frame is not selected.
>
> How can this happen?  In my use, desktop is saved when I kill Emacs,
> and in that case the selected frame is always the last one saved.
>
> That's hwy I asked for a reproducible recipe: I think there are some
> factors at work on your system which I don't understand.

Indeed something strange happens, here is a complete recipe:

0. emacs -Q
1. C-h C-t   (view-emacs-todo)
2. C-x 5 2   (make-frame-command)
3. C-h C-n   (view-emacs-news)
4. C-x 5 o   (other-frame)
5. M-x desktop-save RET RET
6. C-x C-c

7. emacs -Q -f desktop-read --eval '(message "selected-frame: %S" (selected-frame))'
8. M-: (selected-frame) RET

9. In the *Messages* buffer the printed selected-frame is not the same.
   See more explanations of messages in the *Messages* buffer below:

The next message comes from 'message' added to frameset.el:
frameset-restore frame-list: (#<frame emacs@localhost 0x5572e78000c0> #<frame emacs@localhost 0x5572e71a9eb0>)

The next message comes from 'message' added to frameset.el:
frameset-restore selected-frame: #<frame emacs@localhost 0x5572e71a9eb0>

The next message comes from desktop.el:
Desktop: 2 frames, 2 buffers restored.

The next message comes from 'message' added to desktop.el:
desktop-read selected-frame: #<frame TODO 0x5572e71a9eb0>

The next message comes from 'message' on the command line:
selected-frame: #<frame TODO 0x5572e71a9eb0>

The next message comes from 'message' added to startup.el:
normal-top-level selected-frame: #<frame TODO 0x5572e71a9eb0>

The next message comes from M-: (selected-frame)
#<frame  *Minibuf-1* 0x5572e78000c0>

Here 0x5572e71a9eb0 is the frame with TODO, and 0x5572e78000c0 with NEWS.
(0x5572e71a9eb0 was reused, but 0x5572e78000c0 is a new frame created by frameset-restore)
After loading the former should be selected, but actually the latter is selected.

The 'message' added at the end of 'normal-top-level' shows one value
of selected-frame, but evaluating M-: (selected-frame) immediately after loading
shows another value of selected-frame.

Conclusion:
The window manager always selects the last created frame, i.e.
it seems it's impossible to create a new frame without selecting it.

Here is complete information:

In GNU Emacs 27.0.50 (build 84, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
 of 2019-08-13 built on localhost
Repository revision: 2b329ed420eb15f6738edd402697ac2876b2aa61
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.11906000
System Description: Linux Mint 19.1

Configured using:
 'configure --with-imagemagick'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS GLIB
NOTIFY INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT
LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM THREADS PDUMPER
LCMS2 GMP

Important settings:
  value of $LC_MONETARY: fi_FI.UTF-8
  value of $LC_NUMERIC: fi_FI.UTF-8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Outline

Minor modes in effect:
  bug-reference-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t
  view-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
format-spec rfc822 mml mml-sec password-cache epa derived epg epg-config
gnus-util rmail rmail-loaddefs text-property-search mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils cl-seq cl-extra
help-mode time-date subr-x goto-addr thingatpt seq byte-opt gv bytecomp
byte-compile cconv view vc-git diff-mode easymenu bug-reference noutline
outline easy-mmode desktop frameset cl-loaddefs cl-lib tooltip eldoc
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win
x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow isearch timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote threads dbusbind inotify lcms2 dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty make-network-process emacs)

Memory information:
((conses 16 55782 4941)
 (symbols 48 7047 1)
 (strings 32 19182 1991)
 (string-bytes 1 619171)
 (vectors 16 11862)
 (vector-slots 8 157169 9776)
 (floats 8 36 26)
 (intervals 56 229 0)
 (buffers 992 13))





  reply	other threads:[~2019-08-13 21:29 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-01 21:34 bug#36894: Stability issues in frameset sorting Juri Linkov
2019-08-05 21:17 ` Juri Linkov
2019-08-06 15:14   ` Eli Zaretskii
2019-08-06 22:09     ` Juri Linkov
2019-08-07  2:29       ` Eli Zaretskii
2019-08-09 18:09         ` Juri Linkov
2019-08-09 19:04           ` Eli Zaretskii
2019-08-11 20:51             ` bug#36894: Restore frameset focus and selectedness Juri Linkov
2019-08-12 15:00               ` Eli Zaretskii
2019-08-13 21:29                 ` Juri Linkov [this message]
2019-08-14  8:58                   ` martin rudalics
2019-08-14 14:25                     ` Eli Zaretskii
2019-08-14 20:50                       ` Juri Linkov
2019-08-15  8:12                       ` martin rudalics
2019-08-15 18:36                         ` Juri Linkov
2019-08-15 19:37                           ` Eli Zaretskii
2019-08-16  7:29                           ` martin rudalics
2019-08-17  7:19                         ` Eli Zaretskii
2019-08-17  8:24                           ` martin rudalics
2019-08-17 10:12                             ` Eli Zaretskii
2019-08-17 22:40                               ` Juri Linkov
2019-08-19  7:38                               ` martin rudalics
2019-08-14 20:49                     ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y2zw3gb8.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=36894@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.