From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.bugs Subject: bug#73559: [PATCH] fix NS build focus-in event processing Date: Mon, 30 Sep 2024 10:50:31 -0700 Message-ID: <5DE09C90-164F-47B0-A752-F20C9AC82034@dancol.org> References: <871q113lil.fsf@dancol.org> <86v7yd2wsi.fsf@gnu.org> <86h69x2lud.fsf@gnu.org> <86ed512jhm.fsf@gnu.org> <76FBB8E4-B403-45DF-BFCA-2DE48B05E7A6@dancol.org> <86bk052g5y.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39996"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: K-9 Mail for Android Cc: luangruo@yahoo.com, 73559@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 30 19:53:55 2024 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 1svKao-000AGx-JH for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 30 Sep 2024 19:53:55 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1svKaV-0000in-2l; Mon, 30 Sep 2024 13:53:35 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1svKaT-0000gw-TP for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2024 13:53:34 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1svKaT-0006fS-JM for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2024 13:53:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:From:Date:To:Subject; bh=ulLLh6dMUtODvTZAxvJXTgYmQ4/7DISHF3vgOBGs2ZI=; b=BYRSm10wA7tTEy2xJ/gkqgQurFuGU1pil+M5jfudGMqO82T3EGrnRip80MqltkI/EURaywWQz1CuAdmEG8aEa34k8sYX1ZM6eq4tdmaHoHTHNS8bkNNPnk4PCRTePCEehyp+Ugm37srDULiUOZ/k1HHCdZrmimbuDT+HNro3U+s04d8apF45sW/HMWtRUsk8CKvCYYo6IQooAqgCIk5lvb6pNSMw7qB5JCtWJoHQweelDwp1Unpd7KYR/j0Pc6Pu9nMoa4wBDLVSj/p8gm7jIcVwiSoh930je+y2DWsdPGFEFqaAwXOUuLsq/qZPsAzZQ5G0/aqpjBgExzaUsjh3KA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1svKb0-0003Sf-1d for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2024 13:54:06 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Colascione Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 30 Sep 2024 17:54:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73559 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 73559-submit@debbugs.gnu.org id=B73559.172771883613219 (code B ref 73559); Mon, 30 Sep 2024 17:54:05 +0000 Original-Received: (at 73559) by debbugs.gnu.org; 30 Sep 2024 17:53:56 +0000 Original-Received: from localhost ([127.0.0.1]:46098 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1svKak-0003QM-Hf for submit@debbugs.gnu.org; Mon, 30 Sep 2024 13:53:55 -0400 Original-Received: from dancol.org ([96.126.100.184]:34304) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1svKaI-0003L8-Cq for 73559@debbugs.gnu.org; Mon, 30 Sep 2024 13:53:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID: References:In-Reply-To:Subject:CC:To:From:Date:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=ulLLh6dMUtODvTZAxvJXTgYmQ4/7DISHF3vgOBGs2ZI=; b=FucVAlp+Vyy66gvtP/sojtS7GZ 7eZYoOJ+wHAHdzmMPLV5d8luLnDvy1K6qhwsXfQJ/lbLP1HsMiRXPWzMKCWAyLGFmZIY5bEZ9irCL hdUTsn7J+xVX7aJ5SvU9qH/aBTJ80LxOu++XSIlLpw8WTnOB1oXCftMlaCTvIHBL049ZWXAiFNPAA JXIJGhESXNh1lnCZ+P5hZRshT/7Sp8mqc5+mah2zTTHwV0uZ3lhUdfxe/eBLy2Ccj5VOE9ljoBZNv V/CN1q/eRi1ofKCLUGLETtIFHQxu8vYgND7dH44VOWlRBp1opZ7U/3hdFHP2VVAb/nhSmAJgAvAFA kTCwOiDg==; Original-Received: from [2600:1010:b013:b584:0:5c:111:2701] (port=37436 helo=[IPv6:::1]) by dancol.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1svKXX-0004ZF-1O; Mon, 30 Sep 2024 13:50:32 -0400 In-Reply-To: <86bk052g5y.fsf@gnu.org> 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:292733 Archived-At: On September 30, 2024 10:40:57 AM PDT, Eli Zaretskii wrot= e: >> Date: Mon, 30 Sep 2024 10:05:09 -0700 >> From: Daniel Colascione >> CC: luangruo@yahoo=2Ecom, 73559@debbugs=2Egnu=2Eorg >>=20 >> It's not that the NS pselect waits too long=2E It's that it doesn't kno= w to wake up=2E The focus event is delivered to Emacs by NS as a callback= =2E Unless that callback, one way or another, takes some action to wake up = the event loop, nothing gets processed=2E On Windows, we drain the event qu= eue as a side effect of the message pump, whereas on NS there doesn't seem = to be a separate pump that works this way -- just a callback=2E > >What about making pselect wait on one more descriptor, to which the >callback could then write? That's the moral equivalent of what my patch does=2E My patch just uses th= e existing machinery for waking the main thread instead of adding a new FD= =2E