From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#28496: 25.2; Crash when manipulating fullscreen frames on macOS Date: Sun, 1 Oct 2017 00:23:23 +0100 Message-ID: <20170930232323.GA32875@breton.holly.idiocy.org> References: <20170918163922.GB95903@breton.holly.idiocy.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="BOKacYhQ+x31HxR3" Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1506813856 6074 195.159.176.226 (30 Sep 2017 23:24:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 30 Sep 2017 23:24:16 +0000 (UTC) User-Agent: Mutt/1.9.0 (2017-09-02) Cc: 28496@debbugs.gnu.org To: Duncan Harvey Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Oct 01 01:24:09 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1dyR79-0000oL-D9 for geb-bug-gnu-emacs@m.gmane.org; Sun, 01 Oct 2017 01:24:07 +0200 Original-Received: from localhost ([::1]:40629 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dyR7G-00052N-Qb for geb-bug-gnu-emacs@m.gmane.org; Sat, 30 Sep 2017 19:24:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44162) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dyR77-00052H-EO for bug-gnu-emacs@gnu.org; Sat, 30 Sep 2017 19:24:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dyR74-0000z7-3I for bug-gnu-emacs@gnu.org; Sat, 30 Sep 2017 19:24:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:32917) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dyR73-0000yv-UD for bug-gnu-emacs@gnu.org; Sat, 30 Sep 2017 19:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dyR73-0005x8-OO for bug-gnu-emacs@gnu.org; Sat, 30 Sep 2017 19:24:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Sep 2017 23:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28496 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 28496-submit@debbugs.gnu.org id=B28496.150681381322842 (code B ref 28496); Sat, 30 Sep 2017 23:24:01 +0000 Original-Received: (at 28496) by debbugs.gnu.org; 30 Sep 2017 23:23:33 +0000 Original-Received: from localhost ([127.0.0.1]:41598 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dyR6b-0005wM-I1 for submit@debbugs.gnu.org; Sat, 30 Sep 2017 19:23:33 -0400 Original-Received: from mail-wr0-f178.google.com ([209.85.128.178]:43435) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dyR6Z-0005w4-Td for 28496@debbugs.gnu.org; Sat, 30 Sep 2017 19:23:32 -0400 Original-Received: by mail-wr0-f178.google.com with SMTP id a43so1704410wrc.0 for <28496@debbugs.gnu.org>; Sat, 30 Sep 2017 16:23:31 -0700 (PDT) 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=qMcTj2UpGQCoreFFpXqBJqiY0pJdfEz4evqIPzuhcGE=; b=lXplR84Xv/P2XI3uc8CH52NBv34T5UR8bEIQN64lkff0HZYRkQqYoke2bFL1RJ/TDK N8LWXQt/co7QDtwGY04YknKfR42obH2ZZ/Fwbedu2BLeFbVg14WXP9dPg4x/Sse433QO Bcl+uE2qrMESgx7cUUYSp5pwncf11JMRsigVzqlR3fhp6MZAsJsz/JyG0e4hw9SNtQPg PaGI2AT7ammolelbx+XHCN5MUp+BN1m6FiGrz9kFkdpvDRntV0IKdsYXmiZ6ze5feuxp 32f0iCk75iBgHwmv+Ri9s3UzuN1Qkgh1tPzu8QNFr0v9CituPUf9KHtHreNSR76QPT9W 8ZxA== 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=qMcTj2UpGQCoreFFpXqBJqiY0pJdfEz4evqIPzuhcGE=; b=WSmWmCu5N9fArkAEs7n0CQiffM1PEw6wI8L+LDiYYYpyDrdD3yMduWovo9g9PVpYhT t/j/eVCjXM2AAuJmwulQXcRdyxP1OlEWMYExTtWh0cSie85eaYwTj7LZo3v/r2tunB/Y UwmkY+ovcQM2TyXvarAFXkzyuwS2L08gF7zjeYJKxL5yuGDqrKHbVsar0fosRGdPOp3G DUOBAV4VEVB0hDeBk5FvNI4sXWRbBpobVCS8yZoabL0DL73OaiJ8f0jhlviFgpX03/zZ UYvbOgurEFFEiKfQ7O8pfmqoKZL6ossd4iIhgV8ew3Ce6GnDRlDleds3TMN1QWJzgahT KSPA== X-Gm-Message-State: AHPjjUgGc10IkcUtufEzMN64szfhBH5w0U3+CRj/Fme8FidDFoQ+qtj7 EaOC+GORFZcBpI4NWks1WvkzG1Jv X-Google-Smtp-Source: AOwi7QAE9Tc7Tg9J4h0WEmzwJTuFPSFa1Si0327gGrlEvVI9/tRph2ZQQTANavuDi/9SpcEaDn/wEQ== X-Received: by 10.223.163.18 with SMTP id c18mr11050900wrb.211.1506813806158; Sat, 30 Sep 2017 16:23:26 -0700 (PDT) Original-Received: from breton.holly.idiocy.org (ip6-2001-08b0-03f8-8129-ad89-e054-05c6-3eca.holly.idiocy.org. [2001:8b0:3f8:8129:ad89:e054:5c6:3eca]) by smtp.gmail.com with ESMTPSA id v30sm493814wra.39.2017.09.30.16.23.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 30 Sep 2017 16:23:25 -0700 (PDT) Content-Disposition: inline In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:137722 Archived-At: --BOKacYhQ+x31HxR3 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Tue, Sep 19, 2017 at 04:49:16PM +0100, Duncan Harvey wrote: > > On macOS Sierra, creating the new frame appears to create a macOS-style tab in the same 'space'. > On El Capitan, creating the new frame creates a new Mac OS X 'space'. Emacs 26 shouldn’t create a new tab any more. > Animating the creation of a new space certainly appears to be > relatively slow (when running under a VM, at least), which lends > weight to your suspicion that it's timing related. I can’t see any way around this in C. I can’t even find a way to prevent native fullscreen from animating, so I’ve gone with just causing toggle-frame-fullscreen to pause for 1 second on macOS. I don’t think anyone will be too bothered by this as I don’t think you can realistically do anything in Emacs while the animation is running anyway. BTW, running your script with native fullscreen disabled causes a crash here, and this pause fixes that too. In theory non‐native fullscreen should happen instantly, but there’s a pause in the C code too to fix another issue, so whatever. (see bug#28443) Patch attached. -- Alan Third --BOKacYhQ+x31HxR3 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="0001-Fix-fullscreen-crash-on-macOS-bug-28496.patch" >From 2d756250d7990dc9a6a452e8282cc32d16d2099a Mon Sep 17 00:00:00 2001 From: Alan Third Date: Sun, 1 Oct 2017 00:06:23 +0100 Subject: [PATCH] Fix fullscreen crash on macOS (bug#28496) * lisp/frame.el (toggle-frame-fullscreen): Wait for animation to complete on macOS. --- lisp/frame.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/frame.el b/lisp/frame.el index 76c1842455..b70f55e981 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -2434,7 +2434,11 @@ toggle-frame-fullscreen (set-frame-parameter nil 'fullscreen fullscreen-restore) (set-frame-parameter nil 'fullscreen nil))) (modify-frame-parameters - nil `((fullscreen . fullboth) (fullscreen-restore . ,fullscreen)))))) + nil `((fullscreen . fullboth) (fullscreen-restore . ,fullscreen)))) + ;; Manipulating a frame without waiting for the fullscreen + ;; animation to complete can cause a crash, or other unexpected + ;; behaviour, on macOS (bug#28496). + (when (featurep 'cocoa) (sit-for 1)))) ;;;; Key bindings -- 2.14.1 --BOKacYhQ+x31HxR3--