emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: src/nsterm.m: fix window tabbing on macOS


From: Alan Third
Subject: Re: src/nsterm.m: fix window tabbing on macOS
Date: Sun, 6 Jun 2021 12:36:58 +0100

On Sun, Jun 06, 2021 at 07:07:53PM +0900, Naofumi Yasufuku wrote:
> 
> > On Jun 6, 2021, at 18:13, Alan Third <alan@idiocy.org> wrote:
> > 
> > On Sun, Jun 06, 2021 at 04:48:32PM +1000, Paul W. Rankin wrote:
> >> 
> >> No problemo. Revised patch attached.
> > 
> > Thanks. I've pushed it to master.
> 
> I found the following issues with this macOS native tab commit.
> Does anyone else encounter the same problems?
> 
> 1) Frame height increases (even if frame-inhibit-implied-resize is t).
>   attachment:
>     01_macOS-tab-issue-increases-height.gif
>     01_macOS-tab-issue-increases-height-2.gif … (sets 
> frame-inhibit-implied-resize t)

Strangely I don't see this. The frame stays the same height...

> 2) New tab name is ‘emacs’ instead of buffer name.
>     (even if C-x 5 C-f `find-file-other-frame’)
>   attachment:
>     02_macOS-tab-issue-odd-tab-name.gif

It turns out that when multiple NSViews are put into one NSWindow
using tabs, AppKit doesn't bother telling all the views to update
themselves when the window changes, it appears to only message the
currently visible one. This is a problem.

The tab name issue can be sorted with this change:

modified   src/nsfns.m
@@ -407,6 +407,9 @@ Turn the input menu (an NSMenu) into a lisp list for 
tracking on lisp side.
   if (! [[[view window] title] isEqualToString: str])
     [[view window] setTitle: str];
 
+  if ([[view window] tab])
+    [[[view window] tab] setTitle: str];
+
   if (STRINGP (f->icon_name))
     str = [NSString stringWithLispString: f->icon_name];
 
but the overall window title ends up stuck with something nonsensical.
It's even when worse if you resize the frame manually with the mouse.

I don't know how to fix that.

> 3) Tabs are not shown in fullscreen.
>   attachment:
>     03_macOS-tab-fullscreen-expected-textedit.gif. .. e.g. macOS Test Edit app
>     03_macOS-tab-issue-fullscreen-emacs.gif

Works as expected here. Since the window chrome isn't shown in
fullscreen mode, the tab bar isn't shown.

> 4) Doom modeline is not get focused when tab is closed.
>   This could be a ‘doom-modeline’ problem.
>   attachment:
>     04_macOS-tab-issue-doom-modeline-focus.gif

That looks like it's probably related to some old bug we have open
where in certain circumstances the frame isn't shown as being the
selected frame, despite being the key frame as far as AppKit is
concerned.

> 5) Native tabbing doesn’t work with (ns-transparent-titlebar . t) frame 
> parameter.
>     This could be a limitation of macOS, and expected behavior.

At a guess you'll need to set all frames to have a transparent
titlebar, but perhaps there's more to it than that...
-- 
Alan Third



reply via email to

[Prev in Thread] Current Thread [Next in Thread]