Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to permanently remove fullscreen button from touchbar #997

Closed
mathsaey opened this issue Jan 9, 2020 · 4 comments · Fixed by #1008
Closed

Unable to permanently remove fullscreen button from touchbar #997

mathsaey opened this issue Jan 9, 2020 · 4 comments · Fixed by #1008
Milestone

Comments

@mathsaey
Copy link

mathsaey commented Jan 9, 2020

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/[email protected]/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/[email protected]/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.

@eirnym
Copy link
Contributor

eirnym commented Jan 9, 2020

@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.

@ychin
Copy link
Member

ychin commented Jan 14, 2020

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

@ychin ychin added this to the snapshot-162 milestone Jan 14, 2020
ychin added a commit to ychin/macvim that referenced this issue Mar 1, 2020
Add new global var g:macvim_default_touchbar_fullscreen that can disable
the fullscreen Touch Bar button. Add documentation as well.

Fix macvim-dev#997.
ychin added a commit that referenced this issue Mar 3, 2020
Vim patch 8.2.319

General:

- MacVim is now upgraded to Vim 8.2!

Fixes:

- Fix mvim:// protocol handler to handle spaces in file names. #1002
- Allow the fullscreen toggle on the Touch Bar to be disabled. #997
- Fixed potential infinite recursion draw crash. #985

Targets macOS 10.9+

Script interfaces have compatibility with these versions:

- Lua 5.3
- Perl 5.18
- Python2 2.7
- Python3 3.7
- Ruby 2.7
@ychin
Copy link
Member

ychin commented Sep 14, 2020

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>

@rappazzo
Copy link

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
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants