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: Fri, 17 Nov 2017 17:42:26 +0000 Message-ID: <20171117174226.GA48764@breton.holly.idiocy.org> References: <20170103174900.GA49916@breton.holly.idiocy.org> <83zij6esyt.fsf@gnu.org> <83d1g1ecvh.fsf@gnu.org> <20171116193343.GA18478@breton.holly.idiocy.org> <83r2sxggej.fsf@gnu.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 1510940591 20716 195.159.176.226 (17 Nov 2017 17:43:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 17 Nov 2017 17:43:11 +0000 (UTC) User-Agent: Mutt/1.9.1 (2017-09-22) Cc: gongyi.liao@gmail.com, halley@play-bow.org, mituharu@math.s.chiba-u.ac.jp, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 17 18:43:07 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 1eFkfQ-0004wJ-Mw for ged-emacs-devel@m.gmane.org; Fri, 17 Nov 2017 18:43:04 +0100 Original-Received: from localhost ([::1]:47113 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFkfX-00084X-SO for ged-emacs-devel@m.gmane.org; Fri, 17 Nov 2017 12:43:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60077) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFkew-00084F-Bi for emacs-devel@gnu.org; Fri, 17 Nov 2017 12:42:35 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eFkev-0004Dd-Ev for emacs-devel@gnu.org; Fri, 17 Nov 2017 12:42:34 -0500 Original-Received: from mail-wr0-x22f.google.com ([2a00:1450:400c:c0c::22f]:33659) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eFket-00048s-ON; Fri, 17 Nov 2017 12:42:31 -0500 Original-Received: by mail-wr0-x22f.google.com with SMTP id 4so2779449wrt.0; Fri, 17 Nov 2017 09:42:31 -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=16cUuSsHUVhZxw4glatOD3xcA/u3oRx+HmQ0WgfWbAw=; b=KdxiRTPrPz8/yM0/8quJiZEWa/J7SHwZvcGB7IV4sqP0v96f16v/kNgkGhotssU2Vj oPEn9urLRfxVwgMCEDugjmo7hy2EFcN1VWGLnvGvtJdrdp1qqN92zO5nxT2t4uVZK1WD Dj55oGgJwnmhquGKeuyy96xp0XRGxBHqOnnFVYHGjPyqFU05qzrWFoY0Qz+s4nJjUS7y RoaNTH+yW6qgQ+xb2h3xSRnuBXseSB9CMONx4X4JTbXJnEQ7KoSpiHw8ziAKE+Cj3VXh LMDo41k2YWfeTCBCt15+LtQj/GVUJr1063oX/ENMZzJD9LkmRcecGNgOkMJabAFYhr7R NrVw== 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=16cUuSsHUVhZxw4glatOD3xcA/u3oRx+HmQ0WgfWbAw=; b=UdEMxXb993JscVUC0OisZhHsveympt3q+1Cw6RJZfc98RLHM+LWsq6rmqS0aUYgRQR 84/9ei/y5jycx6cxz1co3/avmDZiN2DRHMtfaFyHzlh1M/Z2YTuEW+ByY/HEfrA/6Ry4 /4QUs4tZ1QZ75bRsCKooyMI2Xdj/uXoq7LCNpUE93mthSeeFrKru9Q4YLntfClkOmElp oxwpbsHpQelVO8H37KAd/0GSphlS85O76gER9ktWBkOersoEeCquBR3AK4ZDBbdOcrzE TgbZu8csyPuowIB0jj2mCac8PSmRZlU+5sArDK3CPh1Bhus3ka+wrXFy3qJ1OV7L7Izd b3wQ== X-Gm-Message-State: AJaThX6vcy145emTgeG43wcdEco6Aei3tWNkqrANMatx0qaHEQXaXtko 8mUQ+tNIqdoRGkPY1gdmrcJ3tBj2 X-Google-Smtp-Source: AGs4zMZtuBmJjae0kKGNppl8Hw4iS1E4x/L5BaijfrcbwH6k0vX8zjeJ1yM0ts+VAQel33t6pbnLaA== X-Received: by 10.223.141.180 with SMTP id o49mr4667628wrb.35.1510940550074; Fri, 17 Nov 2017 09:42:30 -0800 (PST) Original-Received: from breton.holly.idiocy.org (ip6-2001-08b0-03f8-8129-357e-80e8-054f-1249.holly.idiocy.org. [2001:8b0:3f8:8129:357e:80e8:54f:1249]) by smtp.gmail.com with ESMTPSA id y15sm9762955wrc.96.2017.11.17.09.42.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Nov 2017 09:42:28 -0800 (PST) Content-Disposition: inline In-Reply-To: <83r2sxggej.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::22f 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:220254 Archived-At: On Fri, Nov 17, 2017 at 03:53:56PM +0200, Eli Zaretskii wrote: > > Date: Thu, 16 Nov 2017 19:33:43 +0000 > > From: Alan Third > > Cc: Gong-Yi Liao 廖宮毅 , > > Eli Zaretskii , halley@play-bow.org, > > emacs-devel@gnu.org > > > > > (make-thread > > > (lambda () > > > (let (last-nonmenu-event) > > > (setq test (y-or-n-p-with-timeout "test" 2 'timeout))))) > > > > > > Athena: Works. > > > GTK+2: Timeout works, but buttons are not displayed. > > > GTK+3: Hangs. > > > NS: Crashes. > > > > I’m not sure how we could handle that on NS. Perhaps just refuse to > > display the dialogue at all, and return nil? > > If you can detect this situation, it's possible. But silently > returning nil might not be a good idea, as it's hard to distinguish > that from normal return. How about displaying a warning? (You cannot > easily error out in a thread, so that's not a good option.) 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. It’s also possible we could pass the request for the dialogue box over to the main thread, but I don’t know how to deal with return values and so on. Displaying a warning seems like the best option. Thanks. -- Alan Third