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

mac/app: rewrite Application class in swift #14

Closed
wants to merge 9 commits into from
Closed

Conversation

Akemi
Copy link
Owner

@Akemi Akemi commented Apr 1, 2024

No description provided.

Akemi added 8 commits March 31, 2024 02:15
also move main invocation into AppHub and completely delete the old
Application c implementation.
since cocoa is initialising mpv and does several things before the mpv
core does anything and the mpv_handle was passed to the App, this can be
used to log such things before the mpv logging is available. helpful for
debugging especially bundle related things.

the logger mapping looks a bit unintuitive but error is basically yellow
what our warning is and fatal is red what our error is.
this event has several advantages, it unifies the mpv:// url handling,
the dropping of files on the App icon and opening via finder into one
event, and it also lets us remove the file open workaround.

we had to keep track of opened files via the command line because the
event was also triggered by passed files on the command line, leading
to redundant load events.

the new event doesn't trigger from files passed via the command line
anymore.
NSApp.terminate() is not a requirement to properly shut down a cocoa
App since it only calls exit() internally. though when not used the
cocoa termination events won't trigger, which we don't need. this
prevented us to exit with a proper exit code.

rework the whole termination logic to end up at one point where we can
return the exit code from the mpv_main function.

Fixes mpv-player#7456
Copy link

github-actions bot commented Apr 1, 2024

Download the artifacts for this pull request:

Windows
macOS

@Akemi Akemi force-pushed the mac_app_test branch 2 times, most recently from c1df297 to f3f7f2a Compare April 1, 2024 13:39
@Akemi Akemi closed this Apr 1, 2024
@Akemi Akemi deleted the mac_app_test branch April 1, 2024 15:27
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