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: Mon, 7 Jun 2021 23:13:11 +0100 Message-ID: References: <228099F1-BAB6-4E3A-AD0F-FB4282817CEB@bydasein.com> <83mts3ikoa.fsf@gnu.org> <2C0F466D-0FEB-439B-8049-D8EA5FC0B21B@bydasein.com> <8CCF969D-32AF-4542-8838-21DF4AA45523@yasufuku.dev> <9814156B-6B84-4CFA-9F5F-A1B05F19826F@bydasein.com> <312D53B8-0B55-40BD-8652-39848045E639@bydasein.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="19555"; 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 Tue Jun 08 00:14:04 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 1lqNVT-0004pr-Te for ged-emacs-devel@m.gmane-mx.org; Tue, 08 Jun 2021 00:14:03 +0200 Original-Received: from localhost ([::1]:40368 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lqNVT-0006es-0F for ged-emacs-devel@m.gmane-mx.org; Mon, 07 Jun 2021 18:14:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56036) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqNUm-0005xU-Ua for emacs-devel@gnu.org; Mon, 07 Jun 2021 18:13:20 -0400 Original-Received: from outbound.soverin.net ([116.202.65.218]:54129) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqNUj-00088h-Vk for emacs-devel@gnu.org; Mon, 07 Jun 2021 18:13:20 -0400 Original-Received: from smtp.soverin.net (unknown [10.10.3.28]) (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 4CA9060283; Mon, 7 Jun 2021 22:13:14 +0000 (UTC) Original-Received: from smtp.soverin.net (smtp.soverin.net [159.69.232.142]) by soverin.net DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=idiocy.org; s=soverin; t=1623103993; bh=s5LobeB/eDVF6MFH52PjhycVB1v4lL9/sNfMBPyVU60=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TJnY6WG5Iu2XNXayKWjHflfbZR0fh3MKb1+B2FVUiRJf3AgwA9wUHVaup1FG/wOhj C9kJitI2Xt51cisZpEON2XCrMr93270NIJa/sk2Bp5HfsxAm9V8SbXouIPDKYgdOl6 CpnjWUGg8ZWqgl6qDFFszNHmTGJWoLzOXD3LkMj7MAgxs8xviFdpKyNb0aV8Li8+ux eh29iJ+A7/YFh4322Y5ssZg53zr03rHtJwf+khaA7qbtV9rtpH5byMYde2KUNGFTVc 7acqOXiQV6rTamfuYe/sfMHtOSjk9cH6tSS3I/fDgJ7tyvFtXXjsx18J51b5VJ0Nqm 8F/2d16kGvpHw== Original-Received: from alan by faroe.holly.idiocy.org with local (Exim 4.94.2) (envelope-from ) id 1lqNUd-001A0C-V8; Mon, 07 Jun 2021 23:13:11 +0100 Mail-Followup-To: Alan Third , "Paul W. Rankin" , emacs-devel@gnu.org Content-Disposition: inline In-Reply-To: <312D53B8-0B55-40BD-8652-39848045E639@bydasein.com> Received-SPF: pass client-ip=116.202.65.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:270536 Archived-At: On Mon, Jun 07, 2021 at 10:27:42AM +1000, Paul W. Rankin wrote: > > > On 7 Jun 2021, at 4:56 am, Alan Third wrote: > > > > On Sun, Jun 06, 2021 at 10:19:57PM +1000, Paul W. Rankin wrote: > > > >> Alan did you see my video of this in action? > >> https://f002.backblazeb2.com/file/pwr-share/emacs_nsterm.mov > > > > Yeah, I was wrong, it is there and it's very annoying. I think there's > > a mismatch between the calculation of the height of the content and > > the actual height of the content. But if it's that I have no idea why > > it disappears when the toolbar is turned off, because the calculation > > should still be wrong. > > I've forgotten, what macOS version are you on? macOS 11 combines > native toolbars in with the titlebar, so I suspect that the > calculations Emacs is doing expect a separate titlebar and toolbar. 10.14 Emacs does calculate the titlebar and toolbar heights, and it's pretty good at it, frankly, except that the toolbar height includes the tab-bar height as well, and I can't see any way round that because neither the toolbar, nor the tab-bar are accessible as views. I don't think that really matters, though. The only explanation I can come up with is that there's some strange interaction between the frame size when it's created, when the toolbar hasn't been created yet so has zero height, and then putting that window into the tab group. > >> Yeah we're considering this a separate nice-to-have, right? > > > > Yeah, the tabs work exactly as I'd expect them to in fullscreen given > > the way fullscreen works just now. > > > > I have to say I've spent most of the afternoon on this and I'm no > > closer to a solution to the height changing thing, so I'm tempted to > > revert the commit, or put it behind a build flag or something until we > > have a better solution. > > I do not think that is necessary. I'm going to go out on a limb here > and speculate that the problem lies with the way Emacs is > calculating its frame size, not with the OS window manager. The > heart of it is, someone can open up Xcode and whip up a demo app > with zero code that will function perfectly well with native tabs, > it's not functionality that a program needs to implement, so > whatever it is with Emacs that is interfering with or overriding > that functionality has been added in between. That goes without saying, but the fact of the matter is that we're failing miserably to convince Emacs and the tab-bar to live together in harmony. There's very little code in the ns*.m files that tries to calculate the height of the frame, and nothing I do to it makes the slightest bit of a difference to how the frame is drawn with tabs enabled. The fact that when you enable and disable the toolbar the frame size changes is also something I can't explain because Appkit doesn't even give Emacs a chance to set the frame size, it just does it and it even animates the change for us, and lets us know it's been done after the event. Perhaps we've got something set somewhere that says that the NSView can't be resized by Appkit? I don't know, I'm not aware of any setting like that. Unfortunately I think the current naive enabling of the native tabs isn't working and needs more work, so I'm going to revert the change. I'm not saying we can't have the native tabs, just that they need to be better behaved before we enable them. Please keep working on this. -- Alan Third