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 23:50:44 +0300	[thread overview]
Message-ID: <87tvajh3ob.fsf@mail.linkov.net> (raw)
In-Reply-To: <8336i3su1b.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 14 Aug 2019 17:25:52 +0300")

[-- Attachment #1: Type: text/plain, Size: 431 bytes --]

>>  > The window manager always selects the last created frame, i.e.
>>  > it seems it's impossible to create a new frame without selecting it.
>> 
>> The xfce window manager has an option for whether a new window should
>> be automatically given focus or not.
>
> I'm not sure I understand what you both are saying.  Are you saying
> that this problem is impossible to solve in Emacs?

The problem can be solved with this patch:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: frameset-restore-last-focus-frame.patch --]
[-- Type: text/x-diff, Size: 782 bytes --]

diff --git a/lisp/frameset.el b/lisp/frameset.el
index 60b6fe38ad..4f7800630c 100644
--- a/lisp/frameset.el
+++ b/lisp/frameset.el
@@ -1346,6 +1352,16 @@ frameset-restore
 	    (error
 	     (delay-warning 'frameset (error-message-string err) :warning))))))
 
+    ;; Make sure the last selected frame has focus.
+    (let ((last-focus-frame
+           (catch 'last-focus
+             (maphash (lambda (frame _)
+                        (when (frame-parameter frame 'last-focus-update)
+                          (throw 'last-focus frame)))
+                      frameset--action-map))))
+      (when last-focus-frame
+        (select-frame-set-input-focus last-focus-frame)))
+
     ;; Make sure there's at least one visible frame.
     (unless (or (daemonp)
 		(catch 'visible

  reply	other threads:[~2019-08-14 20:50 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
2019-08-14  8:58                   ` martin rudalics
2019-08-14 14:25                     ` Eli Zaretskii
2019-08-14 20:50                       ` Juri Linkov [this message]
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=87tvajh3ob.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.