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 12:48:28 +0100 Message-ID: References: <77D861E8-5987-4434-9B87-B2D021D9E078@korins.ky> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="0kybuCI1c3gbg1bi" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1053"; 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 13:49:16 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 1mPNz1-000Abu-RZ for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 12 Sep 2021 13:49:15 +0200 Original-Received: from localhost ([::1]:47266 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mPNz0-0008SH-Kc for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 12 Sep 2021 07:49:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:32770) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mPNyo-0008Rg-A3 for bug-gnu-emacs@gnu.org; Sun, 12 Sep 2021 07:49:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58856) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mPNyn-0008TA-Ud for bug-gnu-emacs@gnu.org; Sun, 12 Sep 2021 07:49:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mPNyn-0004Gm-NN for bug-gnu-emacs@gnu.org; Sun, 12 Sep 2021 07:49: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 11:49: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.163144732316386 (code B ref 50534); Sun, 12 Sep 2021 11:49:01 +0000 Original-Received: (at 50534) by debbugs.gnu.org; 12 Sep 2021 11:48:43 +0000 Original-Received: from localhost ([127.0.0.1]:42169 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mPNyU-0004GE-M4 for submit@debbugs.gnu.org; Sun, 12 Sep 2021 07:48:43 -0400 Original-Received: from outbound.soverin.net ([116.202.126.228]:35531) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mPNyQ-0004Fm-VF for 50534@debbugs.gnu.org; Sun, 12 Sep 2021 07:48:41 -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 4CC6F51; Sun, 12 Sep 2021 11:48:32 +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=1631447311; bh=QdcpQC2MH76oIUSKtMe65fc3r7tWy+a8qHhMLWxlIP0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=p1Z+YURc4mbo2zQBlLCFX2I4ktjikO7sQ8FsSG5elzpsjCHACaqmspIS7nrSEgd/J csjBP53yeYp+FCtNWJsJbPxIs9x/TfnxnTWL/XceLstyQlfBUyiSuDKgA7EtFnuFlZ cKrQmaLhaaKAnLn245KMzk9raw7QJhSyozCWmLj/23A8fyXjbWa+bfn7NA3WDQvqAO /75c6gPPspWPYAzpTJ7SNU8l3Obkrxq0I302Kfro6k9iavqH0T2CbVno3EAXGIYWsd FF9JHRnprUFBIXfxspqn5+cSeKINgogMsa4/TTgAwhG0eCDo1HRois+naQm4RgHXbD ZaxwvZT2rTZmQ== Original-Received: from alan by faroe.holly.idiocy.org with local (Exim 4.94.2) (envelope-from ) id 1mPNyG-001dMI-H9; Sun, 12 Sep 2021 12:48:28 +0100 Mail-Followup-To: Alan Third , "Kirill A. Korinsky" , 50534@debbugs.gnu.org Content-Disposition: inline In-Reply-To: <77D861E8-5987-4434-9B87-B2D021D9E078@korins.ky> 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:214130 Archived-At: --0kybuCI1c3gbg1bi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sun, Sep 12, 2021 at 02:29:19AM +0200, Kirill A. Korinsky via Bug reports for GNU Emacs, the Swiss army knife of text editors wrote: > Good day! > > I've described this bug here: > https://github.com/hlissner/doom-emacs/issues/5469 > > During investigation I've discovered the exact commit which brokes > toolbar on this scenario. > > Let me share git bisect log: > git bisect start > # good: [cfcf42ff879f766ffe5812fb0cd12f35803c1bfb] Ensure that gud commands for non-GDB debuggers are handled by repeat-mode > git bisect good cfcf42ff879f766ffe5812fb0cd12f35803c1bfb > # bad: [192a384408cc846d8e66e91a67cd9ad4e7f0be24] Revert usage of format-prompt in python.el > git bisect bad 192a384408cc846d8e66e91a67cd9ad4e7f0be24 > # bad: [beb54dc1b2b00cb4541b82acf6ead8a8075c3011] Improve documentation of 'file-preserve-symlinks-on-save' > git bisect bad beb54dc1b2b00cb4541b82acf6ead8a8075c3011 > # bad: [c56e395edf5babdbcc65fa7bdb9fb462c674f156] Let image-dired-mouse-toggle-mark act on active region > git bisect bad c56e395edf5babdbcc65fa7bdb9fb462c674f156 > # bad: [0ec67a295632f3c4ac92e0b6a0070f67dedac4eb] ; so-long-tests.el: Suppress expected warnings > git bisect bad 0ec67a295632f3c4ac92e0b6a0070f67dedac4eb > # bad: [12c5ca4d825496b3c7304b75ab82a6fabdc2023d] Fix some macOS problems > git bisect bad 12c5ca4d825496b3c7304b75ab82a6fabdc2023d > # good: [0bd1346318fe9ef4eba91905172d30a030d7da18] Fix issue with mml-preview from outside Gnus > git bisect good 0bd1346318fe9ef4eba91905172d30a030d7da18 > # good: [55a9c17cef78b1fd3da42bcc2ab55d4acbaa24eb] Change Tramp version to "2.5.2-pre" > git bisect good 55a9c17cef78b1fd3da42bcc2ab55d4acbaa24eb > # good: [a4d2c88cdee90a3e4863a62c4ff69896d0c1a347] Simplify macOS drawing code > git bisect good a4d2c88cdee90a3e4863a62c4ff69896d0c1a347 > # bad: [1ba02d85a964e1b2c6a9735cd3decdc524e06dc1] Fix macOS live resize drawing > git bisect bad 1ba02d85a964e1b2c6a9735cd3decdc524e06dc1 > # bad: [960f3fc589d8d021e1ed1a505e660929e4c13d0a] Change NS port resize detection > git bisect bad 960f3fc589d8d021e1ed1a505e660929e4c13d0a > # good: [1535c81f77153dd61426246be2e8afd33fa6909a] Tidy up NS port OS window handling > git bisect good 1535c81f77153dd61426246be2e8afd33fa6909a > # first bad commit: [960f3fc589d8d021e1ed1a505e660929e4c13d0a] Change NS port resize detection I can't for the life of my see why that commit should break it, but can you please try the attached patch and see if it fixes the problem? I can't replicate it here. -- Alan Third --0kybuCI1c3gbg1bi Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-Fix-incorrectly-appearing-toolbar-on-NS-bug-50534.patch" >From 527ba13636c83f826d385de628d5e56556cfa021 Mon Sep 17 00:00:00 2001 From: Alan Third Date: Sun, 12 Sep 2021 12:42:11 +0100 Subject: [PATCH] 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/nsterm.h | 3 +++ src/nsterm.m | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/nsterm.h b/src/nsterm.h index 6d4ea77121..8fb9c0fda1 100644 --- a/src/nsterm.h +++ b/src/nsterm.h @@ -1074,6 +1074,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 8d88f7bd3d..24a2383848 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -1025,7 +1025,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]; @@ -7403,7 +7403,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]; @@ -7462,7 +7462,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 --0kybuCI1c3gbg1bi--