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#53276: The blink-cursor-mode not work after startup on macOS Date: Sat, 15 Jan 2022 12:34:10 +0000 Message-ID: References: <871r19eayk.fsf@yahoo.com> 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="29049"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eason Huang , 53276@debbugs.gnu.org To: Po Lu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 15 13:35:20 2022 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 1n8iH9-0007JC-QW for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 15 Jan 2022 13:35:19 +0100 Original-Received: from localhost ([::1]:56218 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n8iH8-0007u0-Qk for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 15 Jan 2022 07:35:18 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:52536) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8iGx-0007rh-2P for bug-gnu-emacs@gnu.org; Sat, 15 Jan 2022 07:35:07 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46430) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n8iGr-0001Y6-PN for bug-gnu-emacs@gnu.org; Sat, 15 Jan 2022 07:35:06 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n8iGr-0001PQ-OG for bug-gnu-emacs@gnu.org; Sat, 15 Jan 2022 07:35:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Jan 2022 12:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53276 X-GNU-PR-Package: emacs Original-Received: via spool by 53276-submit@debbugs.gnu.org id=B53276.16422500595356 (code B ref 53276); Sat, 15 Jan 2022 12:35:01 +0000 Original-Received: (at 53276) by debbugs.gnu.org; 15 Jan 2022 12:34:19 +0000 Original-Received: from localhost ([127.0.0.1]:39333 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n8iGB-0001OK-6q for submit@debbugs.gnu.org; Sat, 15 Jan 2022 07:34:19 -0500 Original-Received: from outbound.soverin.net ([116.202.126.228]:53489) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n8iG9-0001O2-13 for 53276@debbugs.gnu.org; Sat, 15 Jan 2022 07:34:18 -0500 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 9148B821; Sat, 15 Jan 2022 12:34:10 +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=1642250049; bh=7R3aqQTyOOMq9Mq3HGSlf0+HQYXJcHMBTShnyZqSFdo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=liX2RE7dY5BdM1XBILghWY1NpEPAjbLupVU4pMGMjIcb7K6ICvo5yTDEy5qIcC40g x4gK+SdbqwFvgLGJnY+S1kgp6vCP1pzQnWayZ806gQQU7jb37iOHX8pa9njTL+1nF2 wne/tjKJsZeOOYRCdjMWW205oZh9Cy+HgFclWAPfGzVZ2IxFx6QG7LF4bF7H55lsxj quu3HJ3QZVjqkk37bUxvDOqm5DtNPRzWZZHkvm7MuO7uq4GAclnY3lW5eAM2L7oHP0 L5KP2dijVOMc7XqEZGKmKKqF9KaJ2rF7P6wUxR/w1kh96H8G/uyuYfNOqLc5pWHXWa HPfayhgYNlQmg== Original-Received: from alan by faroe.holly.idiocy.org with local (Exim 4.95-RC2) (envelope-from ) id 1n8iG2-002RnG-4N; Sat, 15 Jan 2022 12:34:10 +0000 Mail-Followup-To: Alan Third , Po Lu , Eason Huang , 53276@debbugs.gnu.org Content-Disposition: inline In-Reply-To: <871r19eayk.fsf@yahoo.com> 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:224297 Archived-At: On Sat, Jan 15, 2022 at 03:04:35PM +0800, Po Lu wrote: > Eason Huang writes: > > > When Emacs is started at the first time, the blink-cursor-mode does > > not work, and the focus needs to be switched to another > > application, and then switching back again, it will work properly. > > blink-cursor-mode will only start the idle timer that actually blinks > the cursor if at least one frame is focused, but no FOCUS_IN_EVENT is > sent until windowDidBecomeKey is called a second time, as emacs_event is > NULL when windowDidBecomeKey is first called. This is both on GNUstep > and macOS. (Perhaps storing the FOCUS_IN_EVENT into the keyboard buffer > would be an option.) > > Alan, do you have any idea as to why this is? I'm afraid I don't really > understand the NS event loop code. No, I don't know why it's done this way. There are a number of other bugs that have the same root cause, where emacs_event is null because the code is being called outside the run loop and therefore the event never reaches Emacs. My assumption is that there is a reason why it's done this way, but I can't work it out. I had a look at some of the other terms and they *kind of* work in a similar fashion, in that there's one function that scoops up all the events and passes them to Emacs (like ns_read_socket does) but they differ in that the events are queued up by the system before they're read in. So given that I wonder if the NS port is just copying that style from other terms, but it doesn't actually work right. (I sometimes think it would be nice if we had git history for the NS port from before it was merged in, because a lot of these design decisions are ancient and it's unclear why they were made.) -- Alan Third