From: martin rudalics <rudalics@gmx.at>
To: Herbert.Zidek@epcos.com, help-gnu-emacs@gnu.org
Subject: Re: switch-to-buffer-other-frame changes focus/mouse to that other frame
Date: Sat, 16 Oct 2010 09:56:32 +0200 [thread overview]
Message-ID: <4CB95AB0.30007@gmx.at> (raw)
> A "switch-to-buffer-other-frame" switches to a (newly created)
> frame, but keeps the focus (and the mouse) on it's current
> location in
>
> GNU Emacs 22.1.1 (x86_64-suse-linux-gnu, GTK+ Version 2.12.0)
> of 2008-05-16 on willimas
>
> as a "switch-to-buffer-other-window" (with pop-up-frames==f) does.
>
>
> However, the same "switch-to-buffer-other-frame" in
>
> GNU Emacs 23.1.1 (x86_64-suse-linux-gnu, GTK+ Version 2.18.6)
> of 2010-04-01 on build17
>
> gives the focus to (and places the mouse in) the (newly created)
> frame.
>
>
> I don't want to focus on the other-frame in this situation.
> How can I avoid this behavior of Emacs 23.1.1?
You can't, due to possible race conditions with the window manager :-(
Note that `switch-to-buffer-other-frame' is not a good example in this
context. By design, this function permanently selects the window it
uses for showing the buffer and, implicitly, that window's frame. Hence
it's only natural that it does also focus that frame.
But the problem you describe already occurs with `display-buffer' which,
by design, should _not_ select the window where it displays the buffer.
If, however, `display-buffer' shows the buffer in a new frame, it also
transfers focus to that frame and raises it. Emacs 23 transfers focus
even when it _reuses_ an existing frame - there was a longer discussion
on this somehwere around 2007 or 2008 but I don't recall the title of
the thread any more.
It's probably most instructive to look at the rather ill-fated function
`display-buffer-other-frame' in files.el. If we can fix this, we could
try to make the do-not-transfer-focus behavior optional at least on all
those systems that support it reliably.
martin
next reply other threads:[~2010-10-16 7:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-16 7:56 martin rudalics [this message]
[not found] <mailman.8.1287167122.4625.help-gnu-emacs@gnu.org>
[not found] ` <jwv8w1x516w.fsf-monnier+gnu.emacs.help@gnu.org>
2010-10-16 21:17 ` switch-to-buffer-other-frame changes focus/mouse to that other frame Miles Bader
-- strict thread matches above, loose matches on Subject: below --
2010-10-15 9:14 Zidek, Herbert
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=4CB95AB0.30007@gmx.at \
--to=rudalics@gmx.at \
--cc=Herbert.Zidek@epcos.com \
--cc=help-gnu-emacs@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.