From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#36894: Restore frameset focus and selectedness Date: Wed, 14 Aug 2019 00:29:15 +0300 Organization: LINKOV.NET Message-ID: <87y2zw3gb8.fsf@mail.linkov.net> References: <878sscwovy.fsf@mail.linkov.net> <877e7rwbv7.fsf@mail.linkov.net> <834l2uconb.fsf@gnu.org> <874l2uug62.fsf@mail.linkov.net> <83y305btde.fsf@gnu.org> <87h86q8b3m.fsf@mail.linkov.net> <83a7ci9n4j.fsf@gnu.org> <87mugf4e8l.fsf@mail.linkov.net> <8336i6tolz.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="28444"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 36894@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Aug 13 23:39:13 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hxeVb-0007GR-M5 for geb-bug-gnu-emacs@m.gmane.org; Tue, 13 Aug 2019 23:39:12 +0200 Original-Received: from localhost ([::1]:55716 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hxeVa-0007gi-H0 for geb-bug-gnu-emacs@m.gmane.org; Tue, 13 Aug 2019 17:39:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46724) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hxeVT-0007b7-PV for bug-gnu-emacs@gnu.org; Tue, 13 Aug 2019 17:39:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hxeVS-0004Zx-91 for bug-gnu-emacs@gnu.org; Tue, 13 Aug 2019 17:39:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39905) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hxeVS-0004Zd-5N for bug-gnu-emacs@gnu.org; Tue, 13 Aug 2019 17:39:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hxeVS-0003EV-10 for bug-gnu-emacs@gnu.org; Tue, 13 Aug 2019 17:39:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Aug 2019 21:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36894 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 36894-submit@debbugs.gnu.org id=B36894.156573231712390 (code B ref 36894); Tue, 13 Aug 2019 21:39:01 +0000 Original-Received: (at 36894) by debbugs.gnu.org; 13 Aug 2019 21:38:37 +0000 Original-Received: from localhost ([127.0.0.1]:48726 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hxeV1-0003Dj-NC for submit@debbugs.gnu.org; Tue, 13 Aug 2019 17:38:36 -0400 Original-Received: from blue.elm.relay.mailchannels.net ([23.83.212.20]:26597) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hxeUy-0003Da-1K for 36894@debbugs.gnu.org; Tue, 13 Aug 2019 17:38:33 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 8AF1C6A29A9; Tue, 13 Aug 2019 21:38:30 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a45.g.dreamhost.com (100-96-91-66.trex.outbound.svc.cluster.local [100.96.91.66]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 10A4D6A28CA; Tue, 13 Aug 2019 21:38:30 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a45.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.17.5); Tue, 13 Aug 2019 21:38:30 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Decisive-Fearful: 5d4a9a9a1a5835a8_1565732310299_2408198308 X-MC-Loop-Signature: 1565732310299:1553747448 X-MC-Ingress-Time: 1565732310299 Original-Received: from pdx1-sub0-mail-a45.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a45.g.dreamhost.com (Postfix) with ESMTP id 3376D7F550; Tue, 13 Aug 2019 14:38:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=FPHnQ2WxNQJRkPir8rcisO4ngPA=; b= UsRFx2+dlooSf3jy5nmR1zNpIgHVnYkdRBktOET/bExwKkIvTaK7zx3vdgyuEUYu NQzwETTL865j1SEkQF8T+jMHcJansifjKq8p+xracuik/QBSkBeQtE/Frjjqbfme UQhwT+oXZ+RMajAHAHTuMPDljL0VhlQANWd3Nt9crWo= Original-Received: from mail.jurta.org (m91-129-109-163.cust.tele2.ee [91.129.109.163]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a45.g.dreamhost.com (Postfix) with ESMTPSA id 88B467F235; Tue, 13 Aug 2019 14:38:26 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a45 In-Reply-To: <8336i6tolz.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 12 Aug 2019 18:00:56 +0300") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduvddruddvjecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledruddtledrudeifeenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutdelrdduieefpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohepvghlihiisehgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgeptd X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:164952 Archived-At: >> 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: (# #) The next message comes from 'message' added to frameset.el: frameset-restore selected-frame: # 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: # The next message comes from 'message' on the command line: selected-frame: # The next message comes from 'message' added to startup.el: normal-top-level selected-frame: # The next message comes from M-: (selected-frame) # 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))