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

Enter Full Screen menu line repeated #566

Closed
minusf opened this issue Oct 20, 2017 · 9 comments · Fixed by #1092
Closed

Enter Full Screen menu line repeated #566

minusf opened this issue Oct 20, 2017 · 9 comments · Fixed by #1092
Milestone

Comments

@minusf
Copy link

minusf commented Oct 20, 2017

not really sure how to reproduce it, i just notice once in a while when i want to see the window list under the Window menu. maybe others have more details.

screen shot 2017-10-09 at 11 05 58

Sierra 10.12.6

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Oct 10 2017 11:48:35)
MacOS X (unix) version
Included patches: 1-1175
Compiled by Homebrew
@isaki
Copy link

isaki commented Nov 10, 2017

I have seen this issue on High Sierra 10.13.1 as well:

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Nov  6 2017 02:39:16)
macOS version
Included patches: 1-1272
Compiled by root@Traviss-Mac-713.local

@bkmdev
Copy link

bkmdev commented Mar 1, 2018

Same for me in OSX 10.13.1, @isaki-x and still seems to be broken in newer MacVim versions too 🙁 (see below for complete version and build info).

Does anyone have a version installed where this did not occur? If so, perhaps we can use git's bisect to determine when this issue was first introduced, and thus the code responsible for it?

:version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Dec  7 2017 11:42:48)
macOS version
Included patches: 1-1376
Compiled by Homebrew
Huge version with MacVim GUI.  Features included (+) or not (-):
+acl               +clipboard         +digraphs          -footer            +libcall           -mouse_gpm         +odbeditor         +rightleft         +tcl               +virtualedit       -xpm
+arabic            +cmdline_compl     +dnd               +fork()            +linebreak         -mouse_jsbterm     +packages          +ruby              +termguicolors     +visual            -xsmp
+autocmd           +cmdline_hist      -ebcdic            +fullscreen        +lispindent        +mouse_netterm     +path_extra        +scrollbind        +terminal          +visualextra       -xterm_clipboard
-autoservername    +cmdline_info      +emacs_tags        -gettext           +listcmds          +mouse_sgr         +perl              +signs             +terminfo          +viminfo           -xterm_save
+balloon_eval      +comments          +eval              -hangul_input      +localmap          -mouse_sysmouse    +persistent_undo   +smartindent       +termresponse      +vreplace
+balloon_eval_term +conceal           +ex_extra          +iconv             -lua               +mouse_urxvt       +postscript        +startuptime       +textobjects       +wildignore
+browse            +cryptv            +extra_search      +insert_expand     +menu              +mouse_xterm       +printer           +statusline        +timers            +wildmenu
++builtin_terms    +cscope            +farsi             +job               +mksession         +multi_byte        +profile           -sun_workshop      +title             +windows
+byte_offset       +cursorbind        +file_in_path      +jumplist          +modify_fname      +multi_lang        +python            +syntax            +toolbar           +writebackup
+channel           +cursorshape       +find_in_path      +keymap            +mouse             -mzscheme          -python3           +tag_binary        +transparency      -X11
+cindent           +dialog_con_gui    +float             +lambda            +mouseshape        +netbeans_intg     +quickfix          +tag_old_static    +user_commands     -xfontset
+clientserver      +diff              +folding           +langmap           +mouse_dec         +num64             +reltime           -tag_any_white     +vertsplit         +xim
   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  -F/usr/local/opt/python/Frameworks -I/usr/local/Cellar/python/2.7.14/Frameworks/Python.framew
ork/Versions/2.7/include/python2.7 -I/usr/local/Cellar/python/2.7.14/Frameworks/Python.framework/Versions/2.7/include/python2.7 -fno-strict-aliasing -fno-common -dynamic -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototy
pes -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: clang   -L.             -L /BuildRoot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.Internal.sdk/usr/local/libressl/lib -L/BuildRoot/Applications/Xcode.app/Contents/
Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.Internal.sdk/usr/local/lib -L.             -L /BuildRoot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.Internal
.sdk/usr/local/libressl/lib -L/BuildRoot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.Internal.sdk/usr/local/lib -F/usr/local/opt/python/Frameworks -L/usr/local/opt/python/F
rameworks/Python.framework/Versions/2.7/lib/python2.7/config -lpython2.7 -framework CoreFoundation -L/usr/local/lib -o Vim -framework Cocoa -framework Carbon       -lm  -lncurses -liconv -framework AppKit   -fstack-protecto
r  -L/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE -lperl -F/usr/local/opt/python/Frameworks -framework Python  -F/System/Library/Frameworks -framework Tcl -framework CoreFoundation -framework Ruby

@eirnym
Copy link
Contributor

eirnym commented May 18, 2019

Does it still an issue? I can't reproduce it

@isaki
Copy link

isaki commented May 19, 2019

This happened to me relatively recently on 10.14.4 (I just recently upgraded to 10.14.5; I'll if I can make it happen again).

@isaki
Copy link

isaki commented May 31, 2019

I have not been able to reproduce on 10.14.5 with MacVim 8.1.950 (155).

@ychin ychin modified the milestones: snapshot-156, snapshot-157 Jun 9, 2019
@ychin ychin modified the milestones: snapshot-157, snapshot-158 Jul 17, 2019
@isaki
Copy link

isaki commented Aug 12, 2019

I just reproduced it.

image

@eirnym
Copy link
Contributor

eirnym commented Aug 13, 2019

@isaki You're lucky! Could you share any way to reproduce it all the time?

@isaki
Copy link

isaki commented Aug 14, 2019

Actually, I just figured that out a few minutes ago when I noticed it again and realized I had just double opened a file a few times (I had a find command opening some files for me, some of which were already open). However, testing now, I've come up with an even simpler method.

I'm using gvim on the command line (which is just /Applications/MacVim.app/Contents/bin/gvim). Just do this:

gvim foo

Do not not quit it. It doesn't have to be a real file. Just every time you get the warning hit abort. The first time nothing bad happens. Do it again. And again. You will get (n - 1) Enter Full Screen entries where n is the number of aborts.

image

@eirnym
Copy link
Contributor

eirnym commented Aug 14, 2019

@isaki Wow! this magic really works! I'll try to debug it!

@ychin ychin modified the milestones: snapshot-158, snapshot-159 Oct 16, 2019
@ychin ychin modified the milestones: snapshot-160, snapshot-161 Oct 26, 2019
@ychin ychin modified the milestones: snapshot-162, Backlog Mar 3, 2020
@ychin ychin modified the milestones: Backlog, snapshot-166 Sep 18, 2020
ychin added a commit to ychin/macvim that referenced this issue Sep 18, 2020
Previously MacVim would see a lot of duplicate window menu items like
"Enter Full Screen" or "Tile Window to Left of Screen" when the user
toggles between two windows. This is because the `setWindowsMenu:` call
was injecting these items, but AppKit isn't smart enough to de-duplicate
them (unlike the window list at the bottom). Just fix this by making a
copy of the main menu before passing it in. This way every time we try
to set a main menu (which happens whenever we jump among Vim windows as
each Vim can have different menu items), it will be set with a fresh one
that doesn't have the injected menu items in it.

Also, set NSFullScreenMenuItemEverywhere to prevent AppKit from
injecting "Enter Full Screen" items. MacVim already has similar menu
items to handle that.

Also, remove old private API call to `setAppleMenu:`. As far as I could
tell this is not useful anymore in recent macOS versions and that line
of code was written in 2008.

Fix macvim-dev#566, Fix macvim-dev#992
ychin added a commit to ychin/macvim that referenced this issue Sep 20, 2020
Previously MacVim would see a lot of duplicate window menu items like
"Enter Full Screen" or "Tile Window to Left of Screen" when the user
toggles between two windows. This is because the `setWindowsMenu:` call
was injecting these items, but AppKit isn't smart enough to de-duplicate
them (unlike the window list at the bottom). Just fix this by making a
copy of the main menu before passing it in. This way every time we try
to set a main menu (which happens whenever we jump among Vim windows as
each Vim can have different menu items), it will be set with a fresh one
that doesn't have the injected menu items in it.

- This also requires adding a refresh functionality because
  adding/removing items to the original menu no longer get automatically
  reflected to the app since it only knows about the copied version.

Also, set NSFullScreenMenuItemEverywhere to prevent AppKit from
injecting "Enter Full Screen" items. MacVim already has similar menu
items to handle that.

Also, remove old private API call to `setAppleMenu:`. As far as I could
tell this is not useful anymore in recent macOS versions and that line
of code was written in 2008.

Fix macvim-dev#566, Fix macvim-dev#992
ychin added a commit that referenced this issue Sep 21, 2020
Updated to Vim 8.2.1719.

Features
====================

Touch Bar improvements
--------------------

Touch Bar now supports submenus, and allows mixed icon/text displays
using `tmenu`. When in edit modes (e.g. insert), it will also display an
emoji picker as well. See `:help touchbar` for documentation. #1084

Fixes
====================

- Window menu no longer shows duplicate "Enter Full Screen" or "Tile
  Window to Left of Screen" entries whenever the user switches among
  different MacVim windows. #566 #992
- Fix issue where going to full screen mode when titlebar appearance is
  set to "hidden" would result in lost focus of the window. #1078
- The password dialog box when using `:!sudo` or other commands that
  require password entry (`macvim-askpass`) will no longer focus on
  Finder, and will keep the focus on MacVim. #1091
- Fix minor wrong tooltip in the "Appearance" preference pane. #1087
- "General" preference pane will now be correctly sized when Sparkle
  updater is disabled (e.g. Homebrew builds). #1089
- Misc issues were fixed by Vim upstream, e.g. `vimgrep` causing a
  crash, and odd behaviors with using Shift-O on the first line. #1082
  #1083

Compatibility
====================

Requires macOS 10.9 or above.

Script interfaces have compatibility with these versions:

- Lua 5.3
- Perl 5.18
- Python2 2.7
- Python3 3.8
- Ruby 2.7
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.

5 participants