From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Daniel Colascione <dancol@dancol.org>
Cc: 57012@debbugs.gnu.org
Subject: bug#57012: Activating versus raising frames
Date: Sun, 07 Aug 2022 09:55:24 +0800 [thread overview]
Message-ID: <87y1w03jhv.fsf@yahoo.com> (raw)
In-Reply-To: <6c3817726a4fc63e83a3d004dffdf072cae278c5.camel@dancol.org> (Daniel Colascione's message of "Sat, 06 Aug 2022 19:57:41 -0400")
Daniel Colascione <dancol@dancol.org> writes:
> Hoo boy. I spent a bit of time digging into the event code. The root
> cause of the inability of emacsclient to raise the frame is that
> we've been getting X11 event timestamps wrong for some time. In
> particular, 1) in GTK builds, we're not updating the X timestamps for
> keyboard and mouse input events
The reason for that is because GTK is supposed to do that itself, after
the event ends up dispatched to GDK. I will investigate this further.
> , and 2) we're not updating the X timestamp when we get an emacsclient
> request. Because of #2, when we call x-focus-window in
> select-frame-set-input-focus, the timestamp we send along with the
> _NET_ACTIVE_WINDOW request is stale, causing some window managers
> (e.g. cinnamon and kwin) to just ignore the _NET_ACTIVE_WINDOW. But
> because we use _NET_ACTIVE_WINDOW *and* XSetInputFocus and the latter
> works, the overall effect is that the call to
> select-frame-set-input-focus in server.el focuses the Emacs window,
> but doesn't raise it.
That sounds likely to me, thanks for investigating.
> The following patch should fix both problems:
Right, but I saw a similar problem in the DND code, so I'd prefer you
modified `x-display-set-last-user-time' instead. I think adding a
separate FRAME argument to that function would be in order. Aside from
that, this is too X-specific to warrant a terminal hook.
The rest of the code is fine by me (tho there is a
dpyinfo->server_time_monotonic_p flag that can be used to avoid a sync
with the X server when trying to obtain the server time), but needs
coding style fixes. I'm sure you already know how to do that.
next prev parent reply other threads:[~2022-08-07 1:55 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-06 0:54 bug#57012: Activating versus raising frames Daniel Colascione
2022-08-06 1:44 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-06 23:57 ` Daniel Colascione
2022-08-07 1:55 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-08-07 2:07 ` Daniel Colascione
2022-08-07 2:45 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-07 2:52 ` Daniel Colascione
2022-08-07 3:02 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-07 3:11 ` Daniel Colascione
2022-08-07 3:29 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-07 4:10 ` Daniel Colascione
2022-08-07 4:29 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-07 4:59 ` Daniel Colascione
2022-08-07 5:27 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-20 11:30 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
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=87y1w03jhv.fsf@yahoo.com \
--to=bug-gnu-emacs@gnu.org \
--cc=57012@debbugs.gnu.org \
--cc=dancol@dancol.org \
--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).