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: Daniel Colascione <dancol@dancol.org>
Cc: 57012@debbugs.gnu.org
Subject: bug#57012: Activating versus raising frames
Date: Sun, 07 Aug 2022 10:45:15 +0800	[thread overview]
Message-ID: <87czdc3h6s.fsf@yahoo.com> (raw)
In-Reply-To: <06468240-fd7c-72e8-2538-b65dd2f28665@dancol.org> (Daniel Colascione's message of "Sat, 6 Aug 2022 22:07:23 -0400")

Daniel Colascione <dancol@dancol.org> writes:

> The GDK code specifically mentions that programs that handle events
> themselves (like Emacs) need to explicitly update the event time (as
> my patch does)

The GDK documentation is unclear.  You only have to update the event
time if the event is not passed to GDK, by setting *finish to
X_EVENT_DROP, which really only happens with key press events.

> What is the bug?

Client messages sent to x-dnd.el did not automatically update the user
time, causing various selection-related functions to use an outdated
timestamp.

> Sorry, but I strongly disagree. The concept of signaling to the
> underlying window system that the user has interacted in some manner
> with a frame is generic and not X-specific. In fact --- doesn't the
> pgtk backend need an implementation of this hook too? It, like the
> conventional GTK backend, is blind to interactions with the frame
> performed using emacsclient.

No, the PGTK backend doesn't have a concept of "server time".  The GDK
Wayland backend implements them via event serials, which cannot be
generated.  It is also unnecessary to specify the server time when
trying to activate a toplevel window.

The only window system I know of that requires that to be specified is
X, so let's keep the code specific to X.

> I think server_time_monotonic_p is an unnecessary optimization.

It's used during frame synchronization, which naturally requires highly
accurate views of the server time.  Further more, we try to _reduce_ the
amount of calls to XSync, which leads to slow performance over display
connections with high latency.

> The style is fine, thanks.

No, it's not:

> +static bool
> +x_get_server_time (struct frame* f, Time* time)

should be

> +x_get_server_time (struct frame* f, Time *time)

and

> +  if (FRAME_LIVE_P (f)) {
> +    Time server_time;
> +    if (!x_get_server_time (f, &server_time))
> +      error ("Timed out waiting for server timestamp");
> +    x_display_set_last_user_time_1 (
> +      FRAME_DISPLAY_INFO (f), server_time, false, f);
> +  }

Should have the opening braces on a new line.

Thanks.





  reply	other threads:[~2022-08-07  2:45 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
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 [this message]
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=87czdc3h6s.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).