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: Sun, 6 Jun 2021 12:36:58 +0100 Message-ID: References: <4cf0b73bcefc7d159881d368b3a4b7f5@purelymail.com> <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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29006"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , "Paul W. Rankin" , emacs-devel@gnu.org To: Naofumi Yasufuku Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jun 06 14:07:51 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 1lprZG-0007DR-Uf for ged-emacs-devel@m.gmane-mx.org; Sun, 06 Jun 2021 14:07:50 +0200 Original-Received: from localhost ([::1]:36138 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lprZF-0000na-Co for ged-emacs-devel@m.gmane-mx.org; Sun, 06 Jun 2021 08:07:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57184) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lprYM-0008MI-Ns for emacs-devel@gnu.org; Sun, 06 Jun 2021 08:06:54 -0400 Original-Received: from ip6-2001-8b0-3f8-8129-8156-dfb2-c163-4b4b.holly.idiocy.org ([2001:8b0:3f8:8129:8156:dfb2:c163:4b4b]:50386 helo=breton.holly.idiocy.org) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lprYK-0004BC-LD; Sun, 06 Jun 2021 08:06:54 -0400 Original-Received: by breton.holly.idiocy.org (Postfix, from userid 501) id 3022E202C66931; Sun, 6 Jun 2021 12:36:58 +0100 (BST) Mail-Followup-To: Alan Third , Naofumi Yasufuku , "Paul W. Rankin" , Eli Zaretskii , emacs-devel@gnu.org Content-Disposition: inline In-Reply-To: <8CCF969D-32AF-4542-8838-21DF4AA45523@yasufuku.dev> Received-SPF: none client-ip=2001:8b0:3f8:8129:8156:dfb2:c163:4b4b; envelope-from=alan@breton.holly.idiocy.org; helo=breton.holly.idiocy.org X-Spam_score_int: -4 X-Spam_score: -0.5 X-Spam_bar: / X-Spam_report: (-0.5 / 5.0 requ) BAYES_00=-1.9, KHOP_HELO_FCRDNS=0.398, RDNS_DYNAMIC=0.982, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no 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:270476 Archived-At: On Sun, Jun 06, 2021 at 07:07:53PM +0900, Naofumi Yasufuku wrote: > > > On Jun 6, 2021, at 18:13, Alan Third 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