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.bugs Subject: bug#50534: 28.0.50; Toolbar shows despite tool-bar-mode being disabled on macOS Date: Sun, 12 Sep 2021 16:44:50 +0100 Message-ID: References: <77D861E8-5987-4434-9B87-B2D021D9E078@korins.ky> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="B7F0sNCPDnlFJjJa" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33863"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 50534@debbugs.gnu.org To: "Kirill A. Korinsky" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 12 17:46:13 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1mPRgK-0008Tj-SR for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 12 Sep 2021 17:46:13 +0200 Original-Received: from localhost ([::1]:55094 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mPRgI-0001wg-TV for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 12 Sep 2021 11:46:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38858) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mPRg9-0001wW-Vj for bug-gnu-emacs@gnu.org; Sun, 12 Sep 2021 11:46:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60151) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mPRg9-0002cK-OH for bug-gnu-emacs@gnu.org; Sun, 12 Sep 2021 11:46:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mPRg9-0006Ea-KE for bug-gnu-emacs@gnu.org; Sun, 12 Sep 2021 11:46:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Sep 2021 15:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50534 X-GNU-PR-Package: emacs Original-Received: via spool by 50534-submit@debbugs.gnu.org id=B50534.163146150523889 (code B ref 50534); Sun, 12 Sep 2021 15:46:01 +0000 Original-Received: (at 50534) by debbugs.gnu.org; 12 Sep 2021 15:45:05 +0000 Original-Received: from localhost ([127.0.0.1]:43464 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mPRfE-0006DF-NF for submit@debbugs.gnu.org; Sun, 12 Sep 2021 11:45:05 -0400 Original-Received: from outbound.soverin.net ([116.202.126.228]:49119) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mPRfB-0006CL-CA for 50534@debbugs.gnu.org; Sun, 12 Sep 2021 11:45:02 -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 5B61251; Sun, 12 Sep 2021 15:44:54 +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=1631461493; bh=5m/jj4WZT4Q0GvgO0R/hnks3v4qVWlDmuc67OI8+YXk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oSyw9HPP278JtNxFI238JjbANiWOqNMaFYHD8RIAXFZAuxckRr7eFS08cxTu2gTG8 I12WYZeJrRI+hZaedmMsv9fr/efi8jogCeT1FxaotFmQC9aIj+vnNnGO2yog1SP270 YldqFXfxmlUV20xAcPKUoIX4WcfB/WToEmGDbSQjtO6CN5FiH8G42rWxnoOA5bfa4S On8yiDyYKaz+wlNf9VTKH0FigC34eZg4QlmfYpXmSrU3KOt9lUt9WPV45jMgn95GjM b1Sb2etZdm7tGy9gTs43Yah808cxnBgQlI9KyRaaGPQ8kD3yHAxo/DkteKd51Usem6 iieYfew3LLfug== Original-Received: from alan by faroe.holly.idiocy.org with local (Exim 4.94.2) (envelope-from ) id 1mPRf0-001gzX-6m; Sun, 12 Sep 2021 16:44:50 +0100 Mail-Followup-To: Alan Third , "Kirill A. Korinsky" , 50534@debbugs.gnu.org Content-Disposition: inline In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:214143 Archived-At: --B7F0sNCPDnlFJjJa Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sun, Sep 12, 2021 at 02:54:09PM +0200, Kirill A. Korinsky wrote: > I've tried to apply suggested patch to local 192a384408cc846d8e66e91a67cd9ad4e7f0be24 and it doesn't help. Please try this patch. -- Alan Third --B7F0sNCPDnlFJjJa Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v2-0001-Fix-incorrectly-appearing-toolbar-on-NS-bug-50534.patch" >From 70dbd0c9db782d15e0036f27db13a5ed8d9bba0b Mon Sep 17 00:00:00 2001 From: Alan Third Date: Sun, 12 Sep 2021 12:42:11 +0100 Subject: [PATCH v2] Fix incorrectly appearing toolbar on NS (bug#50534) * src/nsterm.h (FRAME_TOOLBAR_P): Work out whether the frame should have a toolbar or not. * src/nsterm.m (ns_update_begin): ([EmacsView windowDidEnterFullScreen]): ([EmacsView windowDidExitFullScreen]): Use new FRAME_TOOLBAR_P instead of the apparently unreliable FRAME_EXTERNAL_TOOL_BAR. * src/nsmenu.m (update_frame_tool_bar): Use new FRAME_TOOLBAR_P. --- src/nsmenu.m | 4 ++-- src/nsterm.h | 3 +++ src/nsterm.m | 6 +++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/nsmenu.m b/src/nsmenu.m index 0d0b2f60c9..08d4fb830e 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m @@ -1090,10 +1090,10 @@ - (void)menu:(NSMenu *)menu willHighlightItem:(NSMenuItem *)item #undef TOOLPROP } - if ([toolbar isVisible] != FRAME_EXTERNAL_TOOL_BAR (f)) + if ([toolbar isVisible] != FRAME_TOOLBAR_P (f)) { f->output_data.ns->in_animation = 1; - [toolbar setVisible: FRAME_EXTERNAL_TOOL_BAR (f)]; + [toolbar setVisible: FRAME_TOOLBAR_P (f)]; f->output_data.ns->in_animation = 0; } diff --git a/src/nsterm.h b/src/nsterm.h index 8640b97d8a..4739fe6d1c 100644 --- a/src/nsterm.h +++ b/src/nsterm.h @@ -1044,6 +1044,9 @@ #define FIRST_CHAR_POSITION(f) \ (! (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f)) ? 0 \ : FRAME_SCROLL_BAR_COLS (f)) +#define FRAME_TOOLBAR_P(f) (FRAME_EXTERNAL_TOOL_BAR (f) \ + && FRAME_TOOL_BAR_LINES (f) > 0) + extern struct ns_display_info *ns_term_init (Lisp_Object display_name); extern void ns_term_shutdown (int sig); diff --git a/src/nsterm.m b/src/nsterm.m index f8b8c1e574..9f129be29c 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -1038,7 +1038,7 @@ static NSRect constrain_frame_rect(NSRect frameRect, bool isFullscreen) if ([view isFullscreen] && [view fsIsNative]) { // Fix reappearing tool bar in fullscreen for Mac OS X 10.7 - BOOL tbar_visible = FRAME_EXTERNAL_TOOL_BAR (f) ? YES : NO; + BOOL tbar_visible = FRAME_TOOLBAR_P (f); NSToolbar *toolbar = [[FRAME_NS_VIEW (f) window] toolbar]; if (! tbar_visible != ! [toolbar isVisible]) [toolbar setVisible: tbar_visible]; @@ -7328,7 +7328,7 @@ - (void)windowDidEnterFullScreen /* provided for direct calls */ } else { - BOOL tbar_visible = FRAME_EXTERNAL_TOOL_BAR (emacsframe) ? YES : NO; + BOOL tbar_visible = FRAME_TOOLBAR_P (emacsframe); #if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 \ && MAC_OS_X_VERSION_MIN_REQUIRED <= 1070 unsigned val = (unsigned)[NSApp presentationOptions]; @@ -7387,7 +7387,7 @@ - (void)windowDidExitFullScreen /* provided for direct calls */ #if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 [self updateCollectionBehavior]; #endif - if (FRAME_EXTERNAL_TOOL_BAR (emacsframe)) + if (FRAME_TOOLBAR_P (emacsframe)) { [[[self window] toolbar] setVisible:YES]; update_frame_tool_bar (emacsframe); -- 2.30.2 --B7F0sNCPDnlFJjJa--