From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Third Newsgroups: gmane.emacs.devel Subject: Re: UI input unresponsive on macOS Date: Sat, 2 Dec 2017 16:51:46 +0000 Message-ID: <20171202165146.GA6174@breton.holly.idiocy.org> References: <83zij6esyt.fsf@gnu.org> <83d1g1ecvh.fsf@gnu.org> <20171116193343.GA18478@breton.holly.idiocy.org> <83r2sxggej.fsf@gnu.org> <20171117174226.GA48764@breton.holly.idiocy.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1512233552 13768 195.159.176.226 (2 Dec 2017 16:52:32 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 2 Dec 2017 16:52:32 +0000 (UTC) User-Agent: Mutt/1.9.1 (2017-09-22) Cc: Eli Zaretskii , halley@play-bow.org, gongyi.liao@gmail.com, emacs-devel@gnu.org To: YAMAMOTO Mitsuharu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 02 17:52:28 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eLB1f-0003I5-87 for ged-emacs-devel@m.gmane.org; Sat, 02 Dec 2017 17:52:27 +0100 Original-Received: from localhost ([::1]:36201 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eLB1m-0004zm-83 for ged-emacs-devel@m.gmane.org; Sat, 02 Dec 2017 11:52:34 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40870) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eLB16-0004zV-Qt for emacs-devel@gnu.org; Sat, 02 Dec 2017 11:51:53 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eLB16-00072k-32 for emacs-devel@gnu.org; Sat, 02 Dec 2017 11:51:52 -0500 Original-Received: from mail-wr0-x22c.google.com ([2a00:1450:400c:c0c::22c]:44008) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eLB14-0006yZ-MI; Sat, 02 Dec 2017 11:51:50 -0500 Original-Received: by mail-wr0-x22c.google.com with SMTP id z34so13059242wrz.10; Sat, 02 Dec 2017 08:51:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=BNo1JUANOB9UG/DpUulm2YzhseDqt0t2FCte28XTCzk=; b=TOPmnbBCUK3eC3RGGU8/OsbhCcr/4ZvbU/+KSMOuruiSQza6977ZbUBJ6B5zuaGt1b wpvQX+jLABSRddtBR3wuURJXlAopplLZZmc2G5ztl2uVTtHnkW3Iua9RUtUD6IV+h7FU siG6vgFXDY/FDgdT6D66OhaSBEyDgyPhBr/3AHcMtLH26z5NLqpu/qoY7G0XiVhNDDZZ OcdhqkaR3z5taMkaIpVBoOk+okbI8OS75hv+Ot5yIljLoxc2YuxzvMpMsUMLsDq7sONa 9H2C26YlF3zJO4i+6Xv7fISH5pGxg3pbOM6cVESdz/wlV+NLEot5epHVyOcU7W/MOP3h zt3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=BNo1JUANOB9UG/DpUulm2YzhseDqt0t2FCte28XTCzk=; b=gqB3gzYLjOOUOZVrPnBV9osjphXEQLzwsWyaZYYflLuIDnPnQ1GbZLBt4aDTzdz5Kp LgEYcoo3zwbius13fVGZpNLiRGr1n3GLzIMZ1UUxWYeHmPq70HGFtkq/jYFATaozZBFx /thD/VmAF0SKNU92niNF9R9+S5ITDF6BDf1Paixxrg8nEfM9eUIV6dKuC88RB1/naaSm 7pwSUl1oP7LM15pinpqjQE6J3vEyp26BuEUEmmxKqXnZs/rxcwgmUYQriqzGYANQkLe7 Juc21GrAUpiRrlrkWVz2A47QNuVyOmkcvva3coMCSdM1O34iEX1Mp/0W6811rwVhvzX6 CFpA== X-Gm-Message-State: AJaThX6BurjRhOqoWx1XmVd1TNBbahZR7v7dj6SKJO0PPiohS3TkMk8S HVzr0iSK2HH34f6iZ8ZtkAg= X-Google-Smtp-Source: AGs4zMbuABJZDy2ijUwba9gqNMhzxmrxXEpGv41Z/zeYYT9AD3ajYqIIUZmqg1IV8W9Ha+3nFnc+dg== X-Received: by 10.223.139.67 with SMTP id v3mr8229948wra.70.1512233509482; Sat, 02 Dec 2017 08:51:49 -0800 (PST) Original-Received: from breton.holly.idiocy.org (ip6-2001-08b0-03f8-8129-688d-9f2b-8eb4-3f87.holly.idiocy.org. [2001:8b0:3f8:8129:688d:9f2b:8eb4:3f87]) by smtp.gmail.com with ESMTPSA id 30sm7992429wrl.22.2017.12.02.08.51.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 02 Dec 2017 08:51:48 -0800 (PST) Content-Disposition: inline In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::22c X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:220622 Archived-At: On Sat, Nov 18, 2017 at 09:24:17AM +0900, YAMAMOTO Mitsuharu wrote: > > > NS GUI elements need to be handled in the main thread and it’s easy > > enough to check whether we’re in the main thread before trying to > > display the dialogue box. > > Not just for creating a dialog box, but also for an ordinary Emacs > frame (it does not always crash, but it sometimes does). As I said, > the Main Thread Checker makes it easier to detect these cases. > > The Main Thread Checker reports even if you try to move/resize an > existing NSWindow in a non-main thread. Actually even -[NSView frame] > seems to be black-listed. Yes, this looks like it could be a very large job as lots of functions will need a main thread guard. Even something as innocent looking as setting a frame parameter causes an error. I put a guard in the dialog box code and tried the original code again (make-thread #'gnus "gnus") and it threw up a warning in redisplay, so I suppose we’ll have to prevent redisplay happening in a sub‐thread. 2017-12-02 16:36:15.551 Emacs[6922:22033201] Warning: Illegal attempt to access GUI elements from sub-thread. CoreAnimation: warning, deleted thread with uncommitted CATransaction; created by: -- Alan Third