From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#73559: [PATCH] fix NS build focus-in event processing Date: Mon, 30 Sep 2024 20:40:57 +0300 Message-ID: <86bk052g5y.fsf@gnu.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> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5261"; mail-complaints-to="usenet@ciao.gmane.io" Cc: luangruo@yahoo.com, 73559@debbugs.gnu.org To: Daniel Colascione Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 30 20:04:53 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 1svKlQ-0001Fy-Qj for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 30 Sep 2024 20:04:52 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1svKl5-0004bC-PY; Mon, 30 Sep 2024 14:04:31 -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 1svKl3-0004a1-JC for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2024 14:04:29 -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 1svKl3-0007hz-AO for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2024 14:04:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=699H3Yu69bWFGFu/ZchV2c3AdJF+YtNrCE8cN1jgflI=; b=vxMQALCZgiDCy+e5nU5AAIetNI9FhnsmTjcXq7VkbW/RANX3hAq5PYVAEwbsZTKBtb94n2QqMlnYgcq+5OyDnzOqCB6xm+3aB635S/Rq4m+42W9SGEdbQSCrDJQBLWSR+0teZPwesYV8cPqm/PFEXDptoIfUIaUUfQixEjydokWtvW6EvFG/4+m+Lra6AcBfkKRFGim0hr7Wqqu2fixMok2HylUQVJz2Lmma76hj7W+4VNNsU1+sXUkt7P/px9nxcfeby8E5i2xKA+KI4csswX35mhD0zmZ0DBVhkxZVSBnZE+JjlUmVmtFKQLTtwZxx3f+jawAMr0kLasPp/ofhAg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1svKla-0004To-8R for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2024 14:05:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 30 Sep 2024 18:05:02 +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.172771946717166 (code B ref 73559); Mon, 30 Sep 2024 18:05:02 +0000 Original-Received: (at 73559) by debbugs.gnu.org; 30 Sep 2024 18:04:27 +0000 Original-Received: from localhost ([127.0.0.1]:46145 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1svKky-0004Sh-4R for submit@debbugs.gnu.org; Mon, 30 Sep 2024 14:04:26 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:58588) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1svKkw-0004SW-1b for 73559@debbugs.gnu.org; Mon, 30 Sep 2024 14:04:22 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1svKOO-0005NI-Nz; Mon, 30 Sep 2024 13:41:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=699H3Yu69bWFGFu/ZchV2c3AdJF+YtNrCE8cN1jgflI=; b=bETW9FFEp07n r1TTlKWyqTNP9H2vgAmSlNMIh8YORuPMDZw0Idyr7Pf0hZTxOOGzj9b9F1ZVNf3WBnuoXCHc1r3v8 pvDDQ9ONPyO32trJCmWMlBhqXQMx+OCzVgeXTwBQNv2ny4xuquZ7X9W3bFsgGZqNJN/7/wsbJk11S KUnW3eEgpI2NHB2FsUVrXc1bhIMMp5VFVhJWSwsQ8MUVqmL6TEEY1Gn/uJbbp/GLQkRGgBG9L+bxM HCk3ebCWHMK8QEqoeqhNezZz3HW6mZQTBfZmEBKUE38LQUZpum/kUeMhx8744TIO1AjwU7Kv5VPJ7 SZhSU+AfUGPlRRJxu1Pk9g==; In-Reply-To: <76FBB8E4-B403-45DF-BFCA-2DE48B05E7A6@dancol.org> (message from Daniel Colascione on Mon, 30 Sep 2024 10:05:09 -0700) 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:292734 Archived-At: > Date: Mon, 30 Sep 2024 10:05:09 -0700 > From: Daniel Colascione > CC: luangruo@yahoo.com, 73559@debbugs.gnu.org > > It's not that the NS pselect waits too long. It's that it doesn't know to wake up. The focus event is delivered to Emacs by NS as a callback. Unless that callback, one way or another, takes some action to wake up the event loop, nothing gets processed. On Windows, we drain the event queue 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. What about making pselect wait on one more descriptor, to which the callback could then write?