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.devel Subject: Re: src/nsterm.m: fix window tabbing on macOS Date: Wed, 26 May 2021 20:56:19 +0100 Message-ID: References: <9cdf9d6dc55ccd4894d758d3237b0be2@purelymail.com> <03FB7137-A02D-4B94-AF1F-8B7E84DEF5DB@bydasein.com> <39fa782b82e274d3e9c40e934df89d68@purelymail.com> <4cf0b73bcefc7d159881d368b3a4b7f5@purelymail.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="3762"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: "Paul W. Rankin" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed May 26 21:58:36 2021 Return-path: Envelope-to: ged-emacs-devel@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 1llzfn-0000in-Gy for ged-emacs-devel@m.gmane-mx.org; Wed, 26 May 2021 21:58:35 +0200 Original-Received: from localhost ([::1]:46952 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llzfm-0004r5-FE for ged-emacs-devel@m.gmane-mx.org; Wed, 26 May 2021 15:58:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49808) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llzdm-0003Ju-JA for emacs-devel@gnu.org; Wed, 26 May 2021 15:56:31 -0400 Original-Received: from outbound.soverin.net ([2a01:4f8:fff0:2d:8::218]:41905) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llzdi-0005rA-9x for emacs-devel@gnu.org; Wed, 26 May 2021 15:56:30 -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 3098A609D7; Wed, 26 May 2021 19:56:22 +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=1622058981; bh=7o09MQ7jqEDj/RyctZIz/IbuJaoc3uyQlBIAkUUmDEs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=L68NiI7vCuw47ltEcMo4HSvfsIyYkj7CDNjD20IExQiLyvqN2TZRWKQcDUymlzveE tL6BOOjs+ZuWpZ0NNAAMJjlzF3Y2CMfsjv24glMZAxRSCkJy+75e+CYCE0zJ7ZMWto kIJ51U/EBJpZwq69CUrZnnDOAHoAcm4M5OwOzjvNEzdAEHNPVTGUFSIk4Y2v7jmjs2 EwhE+Ui6BKA3GCz840VALwvd3IYbv9v2ZlIjW1PKGhh8DC7QT4KCFKs8YU2m3zj3JV xV1b9c97poRudbWgNJHK/+doEX+5ivUTP0LJGXzonGJ9uFVNrOLMW7vlfRC9ywzi4V XDh62YQV+iijw== Original-Received: from alan by faroe.holly.idiocy.org with local (Exim 4.94.2) (envelope-from ) id 1llzdb-000GH1-HD; Wed, 26 May 2021 20:56:19 +0100 Mail-Followup-To: Alan Third , "Paul W. Rankin" , emacs-devel@gnu.org Content-Disposition: inline In-Reply-To: <4cf0b73bcefc7d159881d368b3a4b7f5@purelymail.com> Received-SPF: pass client-ip=2a01:4f8:fff0:2d:8::218; envelope-from=alan@idiocy.org; helo=outbound.soverin.net X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_SBL_A=0.1 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:269926 Archived-At: On Sun, May 16, 2021 at 07:16:54PM +1000, Paul W. Rankin wrote: > On 2021-05-14 07:05, Alan Third wrote: > > On Thu, May 13, 2021 at 03:46:54PM +1000, Paul W. Rankin via Emacs > > development discussions. wrote: > > > On 2021-05-13 07:23, Alan Third wrote: > > > You're right and I can't find another macOS app with a tab bar that > > > behaves > > > the way Emacs.app does, so I gotta assume there is something somewhere > > > overriding the Cocoa window manager behaviour. But I'm really only > > > qualified > > > to guess; I looked through nsterm.m and changed a few suspected BOOL > > > values > > > and recompiled a few times but nothing had an effect on the hidden > > > tab bar. > > > > > > Relatedly, tool-bar-mode is in the same boat; hidden in full screen, > > > but > > > probably shouldn't be. > > > > Search in nsterm.m for "autohide", there are a couple of places where > > hiding various bits and bobs is done, all related to fullscreen > > afaict. > > > > I'm not on a Mac just now or I'd try removing them all to see what it > > does. > > Looks like you're on the money! > > I've attached two patches: 0001 is to remove the explicit setting of > NSWindowTabbingModeDisallowed; If you write up a wee NEWS entry, I'll be happy to push this change to master and we can see is anyone shouts. :) Please make sure to mention where to go to turn off tabbing. > 0002 allows visibility of the toolbar and tab > bar in fullscreen (screenshot attached), but reliably causes a segmentation > fault with the following steps: > > 1. System Preferences > Dock > Prefer tabs... [Always] > 2. $ emacs -Q > 3. M-x toggle-frame-full > 4. M-x make-frame > 5. M-x delete-frame > > Attached crash.log. > > Interestingly, calling delete-other-frames does not trigger a crash and when > in windowed (non-fullscreen) a crash is only triggered with the following: > > 1. System Preferences > Dock > Prefer tabs... [Always] > 2. $ emacs -Q > 3. M-x make-frame > 4. M-x make-frame > 5. click close background tab > 6. wait for animation to finish > 7. click close foreground tab Hmm... My money is on something being accessed after being released... It reminds me of some relatively recent fix we made, but I can't for the life of me think what. Anyway, I'm discussing with Andrii in another bug thread about removing the pause that's built into fullscreen transitions so we may want to wait for that to be sorted before we look further into crashes that happen in the same place. > There are three positions someone could take: > > 1. wants tabs in all macOS apps including Emacs.app > 2. does not want tabs in any macOS apps including Emacs.app > 3. wants tabs in all other macOS except for Emacs.app > > Anyone in categories 1 and 2 will be covered by the option in System > Preferences. Given that all I think we're doing here is removing old barrier > code to have Emacs function with an OS's native window manager, anyone in > the third category would be putting the onus on themselves to write code for > additional functionality. Yes, I'm happy enough with this. -- Alan Third