Skip to content

macOS: declare video and audio document types - #684

Open
evilja wants to merge 1 commit into
TypesettingTools:masterfrom
evilja:macos-declare-media-document-types
Open

macOS: declare video and audio document types#684
evilja wants to merge 1 commit into
TypesettingTools:masterfrom
evilja:macos-declare-media-document-types

Conversation

@evilja

@evilja evilja commented Aug 20, 2026

Copy link
Copy Markdown

Problem

On macOS, dragging a video file onto the Aegisub Dock icon is rejected — the icon never highlights and the drop bounces back. In Finder's Open With dialog, Aegisub is greyed out for video and audio files; selecting it requires switching the filter to All Applications, and macOS then records it as a per-file binding rather than learning the association, so it has to be repeated for every single file.

Cause

This is purely a missing declaration — the application code already handles these files.

Project::LoadList() dispatches by extension into video, audio and subtitle loading, and AegisubApp::MacOpenFiles() routes the macOS odoc Apple Event straight into it:

void AegisubApp::MacOpenFiles(wxArrayString const& filenames) { OpenFiles(filenames); }

void AegisubApp::OpenFiles(wxArrayStringsAdapter filenames) {
	...
	frames[0]->context->project->LoadList(files);
}

So any media path that reaches the app loads correctly — this is the same path used by drag-and-drop onto the Aegisub window, which works today. But packages/osx_bundle/Contents/Info.plist declares only .ass, .ssa, .srt and .txt, and LaunchServices decides drop acceptance from CFBundleDocumentTypes. Media files are therefore blocked before they ever reach LoadList().

Change

Declare the video and audio extension lists from Project::LoadList(), so the bundle advertises what the application can already load. Subtitle types are untouched.

Why LSHandlerRank None

None means "never propose this app as a handler for the type" while still allowing the type to be dropped — existing default players (IINA, QuickTime, VLC) are entirely unaffected, and Aegisub does not appear as a suggested handler for anyone's video library. The .txt entry in this file already uses None for the same reason.

I verified that None is sufficient rather than assuming it, using LSCanURLAcceptURL (the acceptance check behind Dock drop highlighting), with minimal test bundles on macOS 15.6:

declared type accepts .mkv
LSHandlerRank None ✅ true
LSHandlerRank Alternate ✅ true
no media type declared (control) ❌ false

Against real bundles:

bundle .mkv .mp4 .wav .flac .ass
current release build
this patch

Subtitle handling is unchanged, and no default handler for any media type is altered.

Notes

  • .sub and .ttxt are also accepted by LoadList() but are deliberately left undeclared here — .sub in particular is ambiguous (VobSub vs. MicroDVD) and not reliably loadable, so declaring it would advertise more than Aegisub can deliver. Happy to add them if preferred.
  • No code changes; single file, declaration only.

🤖 Generated with Claude Code

Project::LoadList() already dispatches dropped/opened files by extension
into video, audio and subtitle loading, and AegisubApp::MacOpenFiles()
routes the macOS `odoc` Apple Event straight into it. The bundle,
however, only declares .ass/.ssa/.srt/.txt, so LaunchServices refuses to
hand any media file to Aegisub: dragging a video onto the Dock icon is
rejected, and Aegisub is greyed out in Finder's "Open With" dialog.

Declare the video and audio extension lists from Project::LoadList so the
bundle advertises what the application can already load. Both entries use
LSHandlerRank "None", as the .txt entry already does, so Aegisub is never
proposed as a handler for media files and existing default players are
left untouched; the declaration only makes the types droppable.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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 this pull request may close these issues.

1 participant