Skip to content

Unable to permanently remove fullscreen button from touchbar #997

Closed

Description

@mathsaey

Describe the bug

I have removed the "toggle full screen button" from my touchbar by putting the following in my gvimrc:

if has("gui_macvim")
  " Remove existing icons from touch bar
  aunmenu TouchBar.
endif

However, once I re-enter fullscreen once, the button reappears. I'm guessing that this is related to the logic that toggles the button between "enter fullscreen" and "leave fullscreen".

To Reproduce

  1. Place the snippet above in .gvimrc
  2. Start macvim (if not in fullscreen, goto 4, otherwise, goto 3)
  3. Leave fullscreen
  4. (Re-)enter fullscreen
  5. The removed button should have reappeared.

Expected behavior
I expect the cleared button to not reappear.

Environment (please complete the following information):

  • os: macOS 10.15.1
  • terminal: GUI
  • vim:
VIM - Vi IMproved 8.1 (2018 May 18, compiled Oct 30 2019 23:05:13)
macOS version
Included patches: 1-2234
Compiled by Homebrew
Huge version with MacVim GUI.  Features included (+) or not (-):
+acl               +file_in_path      +mouse_urxvt       -tcl
+arabic            +find_in_path      +mouse_xterm       +termguicolors
+autocmd           +float             +multi_byte        +terminal
+autochdir         +folding           +multi_lang        +terminfo
-autoservername    -footer            -mzscheme          +termresponse
+balloon_eval      +fork()            +netbeans_intg     +textobjects
+balloon_eval_term +fullscreen        +num64             +textprop
+browse            -gettext           +odbeditor         +timers
++builtin_terms    -hangul_input      +packages          +title
+byte_offset       +iconv             +path_extra        +toolbar
+channel           +insert_expand     +perl              +transparency
+cindent           +job               +persistent_undo   +user_commands
+clientserver      +jumplist          +postscript        +vartabs
+clipboard         +keymap            +printer           +vertsplit
+cmdline_compl     +lambda            +profile           +virtualedit
+cmdline_hist      +langmap           -python            +visual
+cmdline_info      +libcall           +python3           +visualextra
+comments          +linebreak         +quickfix          +viminfo
+conceal           +lispindent        +reltime           +vreplace
+cryptv            +listcmds          +rightleft         +wildignore
+cscope            +localmap          +ruby              +wildmenu
+cursorbind        +lua               +scrollbind        +windows
+cursorshape       +menu              +signs             +writebackup
+dialog_con_gui    +mksession         +smartindent       -X11
+diff              +modify_fname      -sound             -xfontset
+digraphs          +mouse             +spell             +xim
+dnd               +mouseshape        +startuptime       -xpm
-ebcdic            +mouse_dec         +statusline        -xsmp
+emacs_tags        -mouse_gpm         -sun_workshop      -xterm_clipboard
+eval              -mouse_jsbterm     +syntax            -xterm_save
+ex_extra          +mouse_netterm     +tag_binary
+extra_search      +mouse_sgr         -tag_old_static
-farsi             -mouse_sysmouse    -tag_any_white
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/Applications/MacVim.app/Contents/Resources/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe  -DMACOS_X -DMACOS_X_DARWIN  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: clang   -L. -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl@1.1/lib -L/usr/local/opt/readline/lib -L. -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl@1.1/lib -L/usr/local/opt/readline/lib  -L/usr/local/lib -o Vim -framework Cocoa -framework Carbon       -lm  -lncurses -liconv -framework AppKit  -L/usr/local/opt/lua/lib -llua5.3 -fstack-protector  -L/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE -lperl  -L/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/config-3.7m-darwin -lpython3.7m -framework CoreFoundation  -lruby.2.6```

Additional context

I want to remove the button in question since it's quite easy to accidentally hit it when reaching for the "esc" key. Placing it on the right by default might be an idea worth thinking about.

Activity

  1. eirnym commented on Jan 9, 2020

    @eirnym
    Contributor

    @mathsaey Thank you for an issue,

    it's true, as the code handling this will be executed every time. The funny thing, I wonder why it won't be added every time you exit from fullscreen. Probably Apple handles this well.

  2. ychin commented on Jan 14, 2020

    @ychin
    Member

    Will fix this next update. It was a mistake in the way I set it up.

  3. added this to the snapshot-162 milestone on Jan 14, 2020
  4. added a commit that references this issue on Mar 1, 2020
    e24c70d
  5. added a commit that references this issue on Mar 3, 2020
  6. ychin commented on Sep 14, 2020

    @ychin
    Member

    I want to remove the button in question since it's quite easy to accidentally hit it when reaching for the "esc" key. Placing it on the right by default might be an idea worth thinking about.

    I was working on Touch Bar stuff and remembered this issue. @mathsaey I didn't think about this back then, but if you want to put the fullscreen Touch Bar button on the right you just need the following in your vimrc. No need to turn off the button really:

    anoremenu 1.1 TouchBar.-flexspace- <Nop>
    tlnoremenu 1.1 TouchBar.-flexspace- <Nop>
  7. rappazzo commented on Sep 10, 2021

    @rappazzo

    Another tip for those who find this issue later on - I had to put

    "Disable the fullscreen toggle touchbar icon
    let g:macvim_default_touchbar_fullscreen=0
    

    At the top of my vimrc file in order to disable the fullscreen toggle. It didn't work further down in that file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions