From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#57012: Activating versus raising frames Date: Sun, 07 Aug 2022 10:45:15 +0800 Message-ID: <87czdc3h6s.fsf@yahoo.com> References: <18270a59cb0.2829.cc5b3318d7e9908e2c46732289705cb0@dancol.org> <878ro25eo7.fsf@yahoo.com> <6c3817726a4fc63e83a3d004dffdf072cae278c5.camel@dancol.org> <87y1w03jhv.fsf@yahoo.com> <06468240-fd7c-72e8-2538-b65dd2f28665@dancol.org> Reply-To: Po Lu Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37334"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) Cc: 57012@debbugs.gnu.org To: Daniel Colascione Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 07 04:46:17 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oKWIz-0009cH-5l for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 07 Aug 2022 04:46:17 +0200 Original-Received: from localhost ([::1]:57396 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oKWIx-00030i-Rw for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 Aug 2022 22:46:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37454) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oKWIl-00030K-ME for bug-gnu-emacs@gnu.org; Sat, 06 Aug 2022 22:46:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45996) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oKWIj-0004E2-VQ for bug-gnu-emacs@gnu.org; Sat, 06 Aug 2022 22:46:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oKWIj-0007uI-J3 for bug-gnu-emacs@gnu.org; Sat, 06 Aug 2022 22:46:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 07 Aug 2022 02:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57012 X-GNU-PR-Package: emacs Original-Received: via spool by 57012-submit@debbugs.gnu.org id=B57012.165984033430357 (code B ref 57012); Sun, 07 Aug 2022 02:46:01 +0000 Original-Received: (at 57012) by debbugs.gnu.org; 7 Aug 2022 02:45:34 +0000 Original-Received: from localhost ([127.0.0.1]:35745 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oKWII-0007tY-CX for submit@debbugs.gnu.org; Sat, 06 Aug 2022 22:45:34 -0400 Original-Received: from sonic312-25.consmr.mail.ne1.yahoo.com ([66.163.191.206]:38478) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oKWIF-0007tK-Vn for 57012@debbugs.gnu.org; Sat, 06 Aug 2022 22:45:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1659840324; bh=+m0P+juq/5L3t6CCv0Af6QqQpIBugfwn1ijrU8pFVAo=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=iA0EwkdCgkldp0pcuVOBF4kFKlmYf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iLQ8zs9FR_PUx5Od6p79TgHbXSEY8DLLad_FR0rOAMNL5pKE_ 6nk5GUQD8gXSD5BQYSQFs3X4dMX9RfueUZR616P3GH7kDCZffmD_dRfN.hpSzPhTbtweXryo7LD0 5QvwpnvQOcxKSymif4O8XLPvel3OII0FUNaDH5ajnT1GBzlLAUX6YarpNOS_Yt7mktG4zAbZ3i9Q t8_UP1WM6ih4DDlLhYiyAVam_teAVY9R6nt0Q_owK1fju9hEAdoevrqbBYMaVaImyEP_TSXjWowK vCqSW_FgQphXPa_cVx4sl3a0avUDO9cg6O2XvDqaWdo91gcGwdw7npmKhxQ.x6PDzattbAImuscr Wn5jjDb1D0t8t.L5VvmRMLxwarI.aKYomhUmkdS4BRi4sC4M5jESOwny7ztP3DGy0ohQcOJN2a.l qJmSDF2GCpKmXUUFAzQWm5DzgBcz9eBDL2bYiEL4ehauMxLWhCedIKk_w5m3sZRC4f0z3DUqmqqW oZwuMesAFPBa.Dku9wU.e8JqXVIsk2TReJaER_bken6cLfvomgIh1P5TYDK.2JYqhkBdjR7dcHHB sKiDxfrhfcTAHJ9dLjzMHiBETtX22k5euAYB0vL3_f X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.ne1.yahoo.com with HTTP; Sun, 7 Aug 2022 02:45:24 +0000 Original-Received: by hermes--canary-production-sg3-6f58cd9b5-pcmsn (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID f24e79004f61fb44a08871d1bc1807e2; Sun, 07 Aug 2022 02:45:21 +0000 (UTC) In-Reply-To: <06468240-fd7c-72e8-2538-b65dd2f28665@dancol.org> (Daniel Colascione's message of "Sat, 6 Aug 2022 22:07:23 -0400") X-Mailer: WebService/1.1.20491 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:239018 Archived-At: Daniel Colascione 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.