From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#73559: [PATCH] fix NS build focus-in event processing Date: Sun, 29 Sep 2024 23:55:38 -0700 Message-ID: References: <871q113lil.fsf@dancol.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24119"; mail-complaints-to="usenet@ciao.gmane.io" To: Daniel Colascione , 73559@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 30 10:12:58 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 1svBWb-00062P-Sn for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 30 Sep 2024 10:12:57 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1svB9T-0001wH-Sf; Mon, 30 Sep 2024 03:49:04 -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 1svB9Q-0001Zi-My for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2024 03:49:00 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1svB9P-0001MM-NM for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2024 03:49:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:MIME-Version:References:In-Reply-To:From:To:Subject; bh=sLKQdONuiX6LZDLRy6QrOjZIwQfP3d+6U8+SWd7B5Gs=; b=P7Ed+4AcyC/iNhB1poCXhUUqmJR8D8AeoIL2cr6V5gw9jJ+zKG8vsAuEGPXBPnShz8NFO8krrX2kwQ8MXqzh+88OObEsiWPjUtKJdbXXOULVHKZ633P2QCCisUQG5Mx80xrgDlGz6GJ+yKe/0sDxUr+lzzgVv5ZSNksoZc2YrkW+37NPeXXXkqZ8Nfy41U9BZs6EWpyEJjJyT/1lC4TliuTqy3zv4IA4GZesX+Wuy+2oRZEL7iC9BD1l5QlsR8DIskwbDu84l4HWJk85Jt4+BeU4kncidA1cbb29Sq93QBTULTshHtTJnF7/6zApdHG1KQ4NNIAJuMiprLFFLCkXUg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1svAxq-0006is-2p for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2024 03:37:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 30 Sep 2024 07:37: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.172768182125835 (code B ref 73559); Mon, 30 Sep 2024 07:37:02 +0000 Original-Received: (at 73559) by debbugs.gnu.org; 30 Sep 2024 07:37:01 +0000 Original-Received: from localhost ([127.0.0.1]:44576 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1svAxh-0006iB-Ch for submit@debbugs.gnu.org; Mon, 30 Sep 2024 03:37:01 -0400 Original-Received: from mail-lj1-f182.google.com ([209.85.208.182]:44428) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1svAwr-0006XP-Tt for 73559@debbugs.gnu.org; Mon, 30 Sep 2024 03:36:52 -0400 Original-Received: by mail-lj1-f182.google.com with SMTP id 38308e7fff4ca-2fac47f0b1aso11598461fa.1 for <73559@debbugs.gnu.org>; Mon, 30 Sep 2024 00:35:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727681629; x=1728286429; darn=debbugs.gnu.org; h=to:subject:message-id:date:mime-version:references:in-reply-to:from :from:to:cc:subject:date:message-id:reply-to; bh=sLKQdONuiX6LZDLRy6QrOjZIwQfP3d+6U8+SWd7B5Gs=; b=HOHW15+9uRPY52TjpmR0joZbE6th4mWjB2e4PDwrMhQAYk2iMBYQeM0x1xGgGbeAr3 oyYbrC+L9oc1EMetzXLu5BWNc6bHf4JHbfnf5iS/B+OiitQqyO29v0oNh2VVGpzv+5xj TqUfDjzii9D8huoRG15x8Rjlson+NDI/l/RMdpLe8wClVljpqWs2ZPPx/TueUaPbZmS9 j1YPCyvhjLYruEvgN/LGjJGtOz4Ac02yn87vw4RRzNXsY0Q2hE6GubQk1Mz0+hoP1pgz Pq6wZAF+UhbFKQppUD2jB78kkmwsmMPq+QUH9sQwl/6x9GRmDoXK/3d0ml6XOgREHyie sHzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727681629; x=1728286429; h=to:subject:message-id:date:mime-version:references:in-reply-to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=sLKQdONuiX6LZDLRy6QrOjZIwQfP3d+6U8+SWd7B5Gs=; b=a4yUFViyLN0qX3y4G0onow18ywLcNlqlC/0g6DzUA7NHnv0ByHkP0s6n/ha5W/RSF4 jC69GFnpDeDrUHUjgbayEqbdF1+APuJlN7mJCmBXpij50xKBzlp75T5wbUE5XA0x3yKn 5ygFWryVL+iFSno5TnSkhyXu70IEjeD9W/x9yaS0+wNabHE2MacAhKPJpEF5TYo7IoBH n3xKU7VyhEcJRj81f5cJMiAQbyxuBUXdHEJFvUoky7GdKdSj6XPj63OvbDLS0LdgtOnv 46deLXlJyPDFm26dH16DneMSndSzKT11DzjySupvY91FxJ6bja3u8nzRCRi0xuIbWUag TCkA== X-Forwarded-Encrypted: i=1; AJvYcCVFPN8AASd5GnWhgIXWWJK94ZOmiVtmRtweNWyGvZrBSYAFRqGt5Er+01MSMbpTEK+P5QYUmQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzqxQsb68QBlqPoP0mMqkHZDxFE7q6AMxHFdAljyNwCFdO1v7M8 viAqj/eHdjFmouD76WowfODC0l6u0FNekAO2+BFA4spLKa9uoXvt5jUInVM0N3JRUbHLou+VhEi d2ULHs0uMwdkVedEWAE7MuvhqsRPGlA== X-Google-Smtp-Source: AGHT+IGo0+Vyyj+ON72DQt8iwnAB9I/Cu23JEYDBwOPycOefLhCDdUL/8H5gWAU8ejcimCr/IILSrvzmqGN6Juxl1IM= X-Received: by 2002:a2e:a591:0:b0:2f5:2e2:eaf9 with SMTP id 38308e7fff4ca-2f9d3e3c4a0mr53262671fa.4.1727679339105; Sun, 29 Sep 2024 23:55:39 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sun, 29 Sep 2024 23:55:38 -0700 In-Reply-To: <871q113lil.fsf@dancol.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:292694 Archived-At: Daniel Colascione writes: > 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. Thanks for the patch. Please always send patches as attachments if possible, as formatted by git format-patch -1 > 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 > } > >