From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#47731: 28.0.50; Switching frame via keyboard does not fire focus change event Date: Sun, 29 Aug 2021 10:38:38 +0100 Message-ID: References: <875yzwyypp.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13887"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lars Ingebrigtsen , 47731@debbugs.gnu.org To: Sean Farley Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 29 11:39:24 2021 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 1mKHHg-0003Me-F2 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 29 Aug 2021 11:39:24 +0200 Original-Received: from localhost ([::1]:44698 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mKHHe-00048R-Ly for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 29 Aug 2021 05:39:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33424) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mKHHK-000488-TS for bug-gnu-emacs@gnu.org; Sun, 29 Aug 2021 05:39:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43955) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mKHHK-0003dV-LV for bug-gnu-emacs@gnu.org; Sun, 29 Aug 2021 05:39:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mKHHK-0006sI-HL for bug-gnu-emacs@gnu.org; Sun, 29 Aug 2021 05:39:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 29 Aug 2021 09:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47731 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 47731-submit@debbugs.gnu.org id=B47731.163022993126408 (code B ref 47731); Sun, 29 Aug 2021 09:39:02 +0000 Original-Received: (at 47731) by debbugs.gnu.org; 29 Aug 2021 09:38:51 +0000 Original-Received: from localhost ([127.0.0.1]:55499 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKHH9-0006rs-Bp for submit@debbugs.gnu.org; Sun, 29 Aug 2021 05:38:51 -0400 Original-Received: from outbound.soverin.net ([116.202.126.228]:55209) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKHH6-0006rd-P4 for 47731@debbugs.gnu.org; Sun, 29 Aug 2021 05:38:49 -0400 Original-Received: from smtp.soverin.net (unknown [10.10.3.24]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by outbound.soverin.net (Postfix) with ESMTPS id A64D252; Sun, 29 Aug 2021 09:38:42 +0000 (UTC) Original-Received: from smtp.soverin.net (smtp.soverin.net [159.69.232.138]) by soverin.net DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=idiocy.org; s=soverin; t=1630229921; bh=LXrg8DKE8VaXyCwGZzxXzSAQg1s6KiEVTQJ9v9wSZ8k=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kEKsDg1p1flwONeOSqG9spIKgBWq35YYx5hX8N9Uvj9W2rPRA0heTLYWnx+f3gi0S tuRHR4GXoVBPpkiHy/d/nwc0J86m4Okes6YNb6q5Rk723m/UCiXdAqAllgVCy1W0W1 SoABISZERueDTTooJ6oj5iPXvaBw0qCZgQOcY8O5Jrbig/loi3yFKY1YhKCnB7JZ7j f6k3dfo50Pt0pAMu8FuKrY3hBUWGKWqTc0ObuUrD2IooojFMBdnEyn5bDxDbRSzxlV gvKh3lepJ2Q9phl4dv7xkGJc68XbcUkjm/nITEHhWLleQkEKmBn9wBJW4G9oigtnim VxDxxOeG8XYBw== Original-Received: from alan by faroe.holly.idiocy.org with local (Exim 4.94.2) (envelope-from ) id 1mKHGw-0010mv-UI; Sun, 29 Aug 2021 10:38:38 +0100 Mail-Followup-To: Alan Third , Sean Farley , Lars Ingebrigtsen , 47731@debbugs.gnu.org Content-Disposition: inline In-Reply-To: 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" Xref: news.gmane.io gmane.emacs.bugs:212923 Archived-At: On Sat, Aug 28, 2021 at 10:23:35PM -0500, Sean Farley via Bug reports for GNU Emacs, the Swiss army knife of text editors wrote: > > Alan Third writes: > > > On Thu, May 06, 2021 at 11:54:10AM +0200, Lars Ingebrigtsen wrote: > >> Sean Farley writes: > >> > >> > Here is some testing code: > >> > (defun test--focus-out () > >> > (message "FOCUS TEST")) > >> > > >> > (add-function :after after-focus-change-function #'test--focus-out) > >> > (make-frame) > >> > > >> > On macOS, this code runs fine if you click on the other frame. But if > >> > using the keyboard shortcut Command-` the event doesn't fire. It seems > >> > to be some interaction in the keydown event function where emacs_event > >> > is cleared before the call to windowDidBecomeKey. > >> > >> I haven't tested the recipe, but perhaps Alan has some comments here > >> (added to the CCs). > > > > Interestingly the NS port only generates Emacs events for things that > > happen within the NS run loop, which excludes many things that are > > initiated by Emacs itself. > > > > I'm not sure how to fix this as I'm not sure why it's set up this way. > > Is there anything I can do to help? Probably not at the moment. I think we need to rewrite the NS event code so it will create events any time, and then test it to see if it causes problems. I can't see any way it will, but I don't know why it's written this way, so maybe I'm missing something. -- Alan Third