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

Fix misc MacVim warnings #1303

Merged
merged 8 commits into from
Oct 6, 2022
Merged

Fix misc MacVim warnings #1303

merged 8 commits into from
Oct 6, 2022

Commits on Oct 6, 2022

  1. Fix MacVim compiler warnings (for Vim-process files)

    Fix NSStringPboardType and NSFindPboard deprecation warnings.
    
    Also, fix up an awkward use of colors in that we are loading the ARGB
    values of system colors using device calibrated space but CoreText
    renderer uses sRGB instead. Just load it as sRGB.
    
    This should fix up all Vim-side compiler warnings except for the usage
    of NSConnection, which is a much larger task to tackle as we need to
    move to XPC. Note that the set of warnings differ depending on whether
    we have `MACOSX_DEPLOYMENT_TARGET=10.9` set or not as Xcode will
    recommend different changes. With that set we currently do not throw any
    warnings on the Vim process side (since NSConnection was not deprecated
    at 10.9 yet).
    ychin committed Oct 6, 2022
    Configuration menu
    Copy the full SHA
    e9e1290 View commit details
    Browse the repository at this point in the history
  2. Fix build phase dependency warnings

    Make sure to specify the build phase (e.g. building locale files)
    input/output dependencies so they can be properly skipped during
    incremental builds if the input files haven't changed. Previously some
    of them were set to use dependency tracking, but with no input/output
    specified, therefore triggering a warning as Xcode had to run them every
    build.
    ychin committed Oct 6, 2022
    Configuration menu
    Copy the full SHA
    2a6dea1 View commit details
    Browse the repository at this point in the history
  3. Fix warnings due to usages of the deprecated NSStringPboardType

    This turned out more complicated than I thoguht because
    the newer NSPasteboardTypeString (public.utf8-plain-text) is actually a
    different value from NSStringPboardType (NSStringPboardType), so it
    could potentially lead to behavior differences. The right-click Services
    menu in particular seems to not behave in the expected way, because
    writeSelectionToPasteboard: (called by the OS) is passing
    NSStringPboardType to us, even though we specifically only accept
    NSPasteboardTypeString in validRequestorForSendType:returnType:. Just
    fixed the code to ignore the passed in type.
    
    Also update the Info.plist file to accept the public.utf8-plain-text for
    this service as well.
    ychin committed Oct 6, 2022
    Configuration menu
    Copy the full SHA
    2e67bf4 View commit details
    Browse the repository at this point in the history
  4. Fix MacVim warnings: enum renames, graphicsPort, setcmdheight

    The list of warnings fixed:
    
    - Fix misc AppKit control states enums that got renamed and deprecated.
    - NSFindPboardType -> NSPasteboardTypeFind deprecation.
    - Fix usage of deprecated "graphicsPort" API to use CGContext instead.
    - Use NSFontChanging protocol if it's available.
    - Move MMCoreTextView's setcmdheight to the correct section in the private
      implementation category.
    ychin committed Oct 6, 2022
    Configuration menu
    Copy the full SHA
    cd32577 View commit details
    Browse the repository at this point in the history
  5. Fix MMTouchBarButton warning when calling "desc" function

    Refactor the code so that the relevant class is in header and can be
    called. Also fix different places where I call NSClassFromString to use
    @available check instead, as I believe that's the recommended method and
    more efficient as well (due to it being native to the compiler).
    ychin committed Oct 6, 2022
    Configuration menu
    Copy the full SHA
    2faa285 View commit details
    Browse the repository at this point in the history
  6. Fix NSWindowStyleMaskTexturedBackground deprecation warning

    Seems like the flag has been completely useless since macOS 11. We
    previously kept it around despite its deprecation status because it
    seems to make the title bar not show a black line, but since macOS 11 it
    has been showing that anyway, so remove usage of it. Also, clean up misc
    pre-Lion-era code and block them behind ifdef. Can remove those code in
    future if we want to clean up.
    ychin committed Oct 6, 2022
    Configuration menu
    Copy the full SHA
    94564fd View commit details
    Browse the repository at this point in the history
  7. Fix NSFilenamesPboardType -> NSPasteboardTypeFileURL deprecation warning

    This is a little tricky because it's not a simple map. With
    NSPasteboardTypeFileURL, we have to use readObjectsForClasses:options:
    to obtain a list of URL objects and then turn them into file path
    strings. Previously you could just get a list of file names directly
    with NSFilenamesPboardType. Also, this new enum was only defined in
    10.13, so we have to maintain parallel paths to support both types of
    getting the list of file names from the pasteboard. Also refactored the
    code that use this to a function in Miscllaneous.m to avoid the
    headache. Note that the old NSFilenamesPboardType method still works
    today, so this is mostly to clean up old code and deprecation warnings.
    
    Also made the "new file here" plugin accept both the old and new
    pasteboard types, just in case.
    ychin committed Oct 6, 2022
    Configuration menu
    Copy the full SHA
    dc1ad36 View commit details
    Browse the repository at this point in the history
  8. Fix warning: zoomAll / makeWindowsPerform

    Fix the deprecation warning on makeWindowsPerform. While we could simply
    replace it with the more updated form, one thing I noticed was that
    zoomAll: simply wasn't getting called. It appears that NSApplication has
    a native handler of it and would call zoom: on each window by itself,
    and as such there's no point in making our own zoomAll: method at all. I
    couldn't find out if this was the case in old macOS versions, and so
    just ifdef out the zoomAll function in newer versions of macOS which
    also fixes the deprecation warning.
    ychin committed Oct 6, 2022
    Configuration menu
    Copy the full SHA
    c41e05b View commit details
    Browse the repository at this point in the history