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 07:20:26 -0700 Message-ID: References: <871q113lil.fsf@dancol.org> <86v7yd2wsi.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="7582"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: K-9 Mail for Android Cc: 73559@debbugs.gnu.org To: Eli Zaretskii , Po Lu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 30 16:24:00 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 1svHJg-0001nU-1q for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 30 Sep 2024 16:24:00 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1svHJE-0000Cv-ES; Mon, 30 Sep 2024 10:23:32 -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 1svHJC-00007B-MI for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2024 10:23:30 -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 1svHJB-0007FR-PI for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2024 10:23:30 -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=p3n01+WgNwrtX5u5vKmkDLcmnMrk3XlKD7MQK/OGKCU=; b=CyQJ2YFnkYne4eWuBvUk0O683U+y1xv+MKbffzu1+pWlz7DFDL6yXrY7muKLvnVw13qXBWvxKOGYwXI1psQFV7PTUzzL97ZcNxGYwif6OkDjvnJpphqxlixAMUQlilyrkDdw9p7RFa/Ns2Cwyhf7vRyiQCmyYQwvEf6mCW+LQ53XaJpR5u6p5p9tjJGf8ZLqz5SY50ycthN3Y8FsJxtYnP6A/80541cfk8HF3VNynFRlJ8z1uAYQFNDYrJ4N5IJ1eSV6CX46QxCa3Pn5V0Cs2CTY+q6AwC81SsQs7m034bF0iwwJndVQ/xlz1xFfGe1OhXAscddwYVaFCvNPDE7t0w==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1svHJi-0004st-4l for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2024 10:24:02 -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 14:24: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.172770620418683 (code B ref 73559); Mon, 30 Sep 2024 14:24:02 +0000 Original-Received: (at 73559) by debbugs.gnu.org; 30 Sep 2024 14:23:24 +0000 Original-Received: from localhost ([127.0.0.1]:45169 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1svHJ6-0004rH-4J for submit@debbugs.gnu.org; Mon, 30 Sep 2024 10:23:24 -0400 Original-Received: from dancol.org ([96.126.100.184]:43198) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1svHJ2-0004rB-53 for 73559@debbugs.gnu.org; Mon, 30 Sep 2024 10:23:22 -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=p3n01+WgNwrtX5u5vKmkDLcmnMrk3XlKD7MQK/OGKCU=; b=MqsOM1Q0u/KIOfU1QimgDLNzRo ifYATargttY1NC9E2ey6z1ZK6pAheJQGOiZK8RBjP6af7UDMBLmTUIsPEMYKpJQRVze10cqP7AoHV w/WFSdg5JLdqQlvTBHXVDKCS3DXMqfrJfqN2dr7fLevHfAa88bk/JJzkrqN3QfGAcTUTbWIh8W9ai JFy9ZRXaclaxxHtiEv12A4rOxNjRU1Xuqh45ROGksPb2GEETLfI5dkypMttPvObTsLqha/dcKKUxW yBewyDQ8k/qzKNYGtj6X5/8zEqT/QDJUMae/S/Ms+YndEH562Mv4gdVsuawXSTblCzbZO0xB2VpwI V4d47vcg==; Original-Received: from [12.51.135.7] (port=42880 helo=[127.0.0.1]) by dancol.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1svHGG-0003gn-2p; Mon, 30 Sep 2024 10:20:29 -0400 In-Reply-To: <86v7yd2wsi.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:292717 Archived-At: On September 30, 2024 4:41:49 AM PDT, Eli Zaretskii wrote= : >> From: Daniel Colascione >> Date: Sun, 29 Sep 2024 22:47:46 -0400 >>=20 >>=20 >> In Emacs NS build, frames don't respond to focus-in events right away= =2E >> Instead, they store the focus-in event and process it (and other queued >> events) whenever some other event happens to occur on that frame=2E > >Hmm=2E=2E=2E isn't this the same on all other GUI systems? >kbd_buffer_store_event adds the event to the Emacs input queue, and >AFAIU it will be processed as soon as Emacs gets back to its main loop >and calls read_char=2E No other event should be needed, AFAIK=2E Po Lu, >am I missing something here? > >> This patch kicks the NS event loop immediately when a focus-in event >> happens, allowing Emacs to respond to focus-in events without some othe= r >> event triggering the processing=2E I don't recall what we do for other systems, but for NS, we don't wake up = the event loop as a side effect of kbd_buffer_store_event by itself=2E We r= ely on something else waking up the loop draining events from the queue=2E = Changing the kbd_buffer_store_to_event to wake the main thread unconditiona= lly would be another option, but seemed like a bigger change=2E > >I know nothing about the "NS event loop", so I'm probably missing >something=2E > >Thanks=2E