unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Third <alan@idiocy.org>
To: "Paul W. Rankin" <pwr@bydasein.com>
Cc: emacs-devel@gnu.org
Subject: Re: src/nsterm.m: fix window tabbing on macOS
Date: Mon, 7 Jun 2021 23:13:11 +0100	[thread overview]
Message-ID: <YL6Z94lQKTH/Del5@idiocy.org> (raw)
In-Reply-To: <312D53B8-0B55-40BD-8652-39848045E639@bydasein.com>

On Mon, Jun 07, 2021 at 10:27:42AM +1000, Paul W. Rankin wrote:
> 
> > On 7 Jun 2021, at 4:56 am, Alan Third <alan@idiocy.org> 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



  reply	other threads:[~2021-06-07 22:13 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-08  9:26 src/nsterm.m: fix window tabbing on macOS Paul W. Rankin via Emacs development discussions.
2021-05-08 11:21 ` Alan Third
2021-05-08 12:27   ` Paul W. Rankin via Emacs development discussions.
2021-05-08 12:35     ` Paul W. Rankin via Emacs development discussions.
2021-05-10 19:53     ` Alan Third
2021-05-11  5:45       ` Paul W. Rankin via Emacs development discussions.
2021-05-11 19:20         ` chad
2021-05-12  9:47           ` Paul W. Rankin via Emacs development discussions.
2021-05-12 21:23         ` Alan Third
2021-05-13  5:46           ` Paul W. Rankin via Emacs development discussions.
2021-05-13 21:05             ` Alan Third
2021-05-16  9:16               ` Paul W. Rankin via Emacs development discussions.
2021-05-26 19:56                 ` Alan Third
2021-05-27 11:06                   ` Andrii Kolomoiets
2021-05-28  8:26                     ` martin rudalics
2021-05-28  8:28                       ` Paul W. Rankin via Emacs development discussions.
2021-05-28  8:36                         ` martin rudalics
2021-05-28  8:54                           ` Alan Third
2021-06-06  4:09                             ` Paul W. Rankin via Emacs development discussions.
2021-06-06  7:43                               ` martin rudalics
2021-05-28  9:07                           ` Andrii Kolomoiets
2021-05-28  9:21                             ` martin rudalics
2021-05-28  9:37                               ` Paul W. Rankin via Emacs development discussions.
2021-05-28  9:51                                 ` martin rudalics
2021-05-28 14:33                                   ` Paul W. Rankin via Emacs development discussions.
2021-05-28 20:52                                     ` Andrii Kolomoiets
2021-06-05 20:58                   ` Alan Third
2021-06-06  4:01                     ` Paul W. Rankin via Emacs development discussions.
2021-06-06  6:14                       ` Eli Zaretskii
2021-06-06  6:48                         ` Paul W. Rankin via Emacs development discussions.
2021-06-06  9:13                           ` Alan Third
     [not found]                             ` <8CCF969D-32AF-4542-8838-21DF4AA45523@yasufuku.dev>
2021-06-06 11:36                               ` Alan Third
2021-06-06 12:19                                 ` Paul W. Rankin via Emacs development discussions.
2021-06-06 18:56                                   ` Alan Third
2021-06-07  0:27                                     ` Paul W. Rankin via Emacs development discussions.
2021-06-07 22:13                                       ` Alan Third [this message]
2021-06-08  7:32                                         ` Paul W. Rankin via Emacs development discussions.
2021-06-08  8:59                                           ` Eli Zaretskii
2021-06-09  8:35                                         ` martin rudalics
2021-06-09  8:48                                           ` Alan Third
2021-06-09 12:20                                             ` martin rudalics
2021-06-09 12:29                                               ` Alan Third
     [not found] <65f1-60bcfd80-157-23301c40@168015757>
2021-06-07  0:11 ` Paul W. Rankin via Emacs development discussions.
2021-06-07 21:57   ` Alan Third

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YL6Z94lQKTH/Del5@idiocy.org \
    --to=alan@idiocy.org \
    --cc=emacs-devel@gnu.org \
    --cc=pwr@bydasein.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).