unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Protesilaos Stavrou <info@protesilaos.com>,
	61319@debbugs.gnu.org, joseph@ferano.io
Subject: bug#61319: 30.0.50; 'M-x select-frame-by-name' --with-pgtk does not switch focused frame
Date: Mon, 06 Feb 2023 21:40:59 +0800	[thread overview]
Message-ID: <875yce9aj8.fsf@yahoo.com> (raw)
In-Reply-To: <83bkm7q6qn.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 06 Feb 2023 15:10:56 +0200")

Eli Zaretskii <eliz@gnu.org> writes:

>> Cc: Joseph Ferano <joseph@ferano.io>
>> From: Protesilaos Stavrou <info@protesilaos.com>
>> Date: Mon, 06 Feb 2023 12:52:35 +0200
>> 
>> When using Emacs PGTK, the command 'select-frame-by-name' does not
>> switch focus to the selected frame.  Instead, it selects the buffer on
>> the specified frame, but keeps the current frame in focus.
>> 
>> Steps to reproduce with 'emacs -Q':
>> 
>> 1. In the scratch buffer, do 'M-x make-frame'
>> 2. In one of the two frames, switch to another buffer, such as "*Messages*".
>> 3. Do 'M-x select-frame-by-name' and select the other frame.
>
> You are saying that select-frame-set-input-focus doesn't move the
> input focus to the newly-selected frame?  But that is only "best
> effort":
>
>   select-frame-set-input-focus is a byte-compiled Lisp function in
>   ‘frame.el’.
>
>   (select-frame-set-input-focus FRAME &optional NORECORD)
>
>   Select FRAME, raise it, and set input focus, if possible.
>                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> Perhaps Po Lu could try fixing this, but in general Lisp programs and
> users should not rely on success in these cases, because the WM can
> actively prevent Emacs from giving the frame input focus.

The Wayland protocol itself prevents Emacs from doing this.

GTK 3 uses a private Wayland protocol extension named ``gtk-shell''
which is implemented only by GNOME's Wayland compositor; it does not
support the other extension typically used to activate toplevels.

Unless you're using GNOME Shell, I don't think we will be able to make
this work, sorry.  If you do, however, it should already work.  So
please tell us what Wayland compositor you are using.

Thanks.






  reply	other threads:[~2023-02-06 13:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-06 10:52 bug#61319: 30.0.50; 'M-x select-frame-by-name' --with-pgtk does not switch focused frame Protesilaos Stavrou
2023-02-06 13:10 ` Eli Zaretskii
2023-02-06 13:40   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-02-09  8:01     ` Protesilaos Stavrou
2023-02-09  8:19       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-09  9:24         ` Protesilaos Stavrou

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=875yce9aj8.fsf@yahoo.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=61319@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=info@protesilaos.com \
    --cc=joseph@ferano.io \
    --cc=luangruo@yahoo.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).