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: Sun, 29 Sep 2024 22:47:46 -0400 Message-ID: <871q113lil.fsf@dancol.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33431"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.12.6; emacs 31.0.50 To: 73559@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 30 05:30:16 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 1sv770-0008UK-5w for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 30 Sep 2024 05:30:14 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sv76f-00052z-8l; Sun, 29 Sep 2024 23:29:53 -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 1sv76X-00052e-Bl for bug-gnu-emacs@gnu.org; Sun, 29 Sep 2024 23:29:47 -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 1sv76W-00050p-IL for bug-gnu-emacs@gnu.org; Sun, 29 Sep 2024 23:29:45 -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:Date:From:To:Subject; bh=tw3WIiESOrJCL+C4rRvXgI+M3AyQ3reDvLxvpF1yP30=; b=alGNOe6B7VMntjZkvNwj+0eDVcwLTC2YMd7iWvf4Cgo33L0tu0b0JsRrf7AwD1IRAeEI3LEZrvDf0ywoJI/qA6fDKib0PyJkTw82Amp8ULvJJIfUCEliwajRskak21NJwHzmo5FA112ybjVWYxdAtOcu75z7w/QRlLIu+GmhRhbSG+3ZUtLmmyTQ4sYki4Vdr0GO8SRruE2jxUC+h7rAZNZB6x+XaA09v52ke49n2dREVHXM8yQ+K8hJwhiwcmIejN4jrHePsibte7V/YrvKaUE0ZrsQv8zcb0ZeuIJJDzyTiKGOHVfMF+xG4yaCzLGBhCnajLFGZtOgu7X6N6Gh8Q==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sv771-0007nt-RE for bug-gnu-emacs@gnu.org; Sun, 29 Sep 2024 23:30:15 -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 03:30:15 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 73559 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.172766696629303 (code B ref -1); Mon, 30 Sep 2024 03:30:15 +0000 Original-Received: (at submit) by debbugs.gnu.org; 30 Sep 2024 03:29:26 +0000 Original-Received: from localhost ([127.0.0.1]:43969 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sv765-0007bV-OU for submit@debbugs.gnu.org; Sun, 29 Sep 2024 23:29:22 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:39610) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sv75w-0007Zj-Ce for submit@debbugs.gnu.org; Sun, 29 Sep 2024 23:29:13 -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 1sv75P-0004zI-To for bug-gnu-emacs@gnu.org; Sun, 29 Sep 2024 23:28:35 -0400 Original-Received: from dancol.org ([2600:3c01:e000:3d8::1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sv75N-0004nM-SP for bug-gnu-emacs@gnu.org; Sun, 29 Sep 2024 23:28:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Type:MIME-Version:Message-ID:Date:Subject:To:From:Sender: Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=BwVRwDR7UrrHHXs9XVCKtACSIFbaqFO2jrnCjHIBtq4=; b=gcJARsdRwfany5Zy3uB/iijW7d ekjVv8haLUxonQFRBUV0tG8Th4zVGbge9/ykK/usQjyYODImRoOG5207iiVGXeZ/EwgI6dy2uZNga pHpt6Xpo54IRC9CtVbHECfIXl78H0YSxCpSsRHfO5mY0nRa8GBF/Zje3vR+sH1VTBJoeeG9DGywls 3YFTQxqtC9Y6D78Gtcr8uqza7ScC3nx7cmeZkYpqPVzdOK0aTnQRXyAKwOXN5EntN+H0NuPN5G7FH g2qQApV8dRGVryigoUB6JxrfbytjcDpkYvaUwUd9tQ4X5J5T33Bvq8NT7kSFwj8FiM+OVDugjBPx5 tTVCW8eA==; Original-Received: from [2600:3c01:e000:3d8:1::1001] (port=52208 helo=localhost) by dancol.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1sv6S1-00010J-09 for bug-gnu-emacs@gnu.org; Sun, 29 Sep 2024 22:47:55 -0400 Received-SPF: pass client-ip=2600:3c01:e000:3d8::1; envelope-from=dancol@dancol.org; helo=dancol.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:292689 Archived-At: In Emacs NS build, frames don't respond to focus-in events right away. Instead, they store the focus-in event and process it (and other queued events) whenever some other event happens to occur on that frame. This patch kicks the NS event loop immediately when a focus-in event happens, allowing Emacs to respond to focus-in events without some other event triggering the processing. commit c6d98bfc2a098b57fa9631978224ead2668d3a88 Author: Daniel Colascione Date: Wed Aug 21 19:48:05 2024 -0700 process events on focus in diff --git a/src/nsterm.m b/src/nsterm.m index 8c405738467..f68a22d9fbc 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -7973,6 +7973,7 @@ - (void)windowDidBecomeKey /* for direct calls */ event.kind = FOCUS_IN_EVENT; XSETFRAME (event.frame_or_window, emacsframe); kbd_buffer_store_event (&event); + ns_send_appdefined (-1); // Kick main loop }