From afdc9c4ae2e69a9ced6c3c6580df19edfedea36a Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sat, 23 Feb 2013 18:28:22 +0100 Subject: OSX: use native Cocoa's event loop Schedule mpv's playloop as a high frequency timer inside the main Cocoa event loop. This has the benefit to allow accessing menus as well as resizing the window without the playback being blocked and allows to remove countless hacks from the code that involved manually pumping the event loop as well simulating manually some of the Cocoa default behaviours. A huge improvement consists in removing NSApplicationLoad. This is a C function defined in the Cocoa header and implements a minimal OSX application under ther hood so that you can use the Cocoa GUI toolkit from C/C++ without having to respect the Cocoa standards in terms of application initialization. This was bad because the behaviour implemented by NSApplicationLoad was hard to customize and had several gotchas especially in the menu department. mpv was changed to be just a nib-less application. All the Cocoa part is still generated in code but the event handling is now not dissimilar to what is present in a stock Mac application. As a part of reviewing the initialization process, I also removed all of `osdep/macosx_finder_args`. The useful parts of the code were moved to `osdep/macosx_appication` which has the broaded responsibility of managing the full lifecycle of the Cocoa application. By consequence the `--enable-macosx-finder` configure switch was killed as well, as this feature is always enabled. Another change the users will notice is that when using a bundle the `--quiet` option will be inserted much earlier in the initializaion process. This results in mpv not spamming mpv.log anymore with all the initialization outputs. --- configure | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'configure') diff --git a/configure b/configure index a9edaab93b..83db6cc188 100755 --- a/configure +++ b/configure @@ -316,8 +316,6 @@ Optional features: --disable-dvdread disable libdvdread [autodetect] --disable-cddb disable cddb [autodetect] --disable-enca disable ENCA charset oracle library [autodetect] - --enable-macosx-finder enable Mac OS X Finder invocation parameter - parsing [disabled] --enable-macosx-bundle enable Mac OS X bundle file locations [autodetect] --disable-inet6 disable IPv6 support [autodetect] --disable-gethostbyname2 gethostbyname2 part of the C library [autodetect] @@ -476,7 +474,6 @@ _cddb=auto _coreaudio=auto _corevideo=auto _cocoa=auto -_macosx_finder=no _macosx_bundle=auto _enca=auto _inet6=auto @@ -722,8 +719,6 @@ for ac_option do --disable-corevideo) _corevideo=no ;; --enable-cocoa) _cocoa=yes ;; --disable-cocoa) _cocoa=no ;; - --enable-macosx-finder) _macosx_finder=yes ;; - --disable-macosx-finder) _macosx_finder=no ;; --enable-macosx-bundle) _macosx_bundle=yes ;; --disable-macosx-bundle) _macosx_bundle=no ;; @@ -1665,17 +1660,9 @@ echores "$_sys_sysinfo" if darwin; then -echocheck "Mac OS X Finder Support" -def_macosx_finder='#undef CONFIG_MACOSX_FINDER' -if test "$_macosx_finder" = yes ; then - def_macosx_finder='#define CONFIG_MACOSX_FINDER 1' - libs_mplayer="$libs_mplayer -framework Cocoa" -fi -echores "$_macosx_finder" - echocheck "Mac OS X Bundle file locations" def_macosx_bundle='#undef CONFIG_MACOSX_BUNDLE' -test "$_macosx_bundle" = auto && _macosx_bundle=$_macosx_finder +test "$_macosx_bundle" = auto if test "$_macosx_bundle" = yes ; then extra_ldflags="$extra_ldflags -headerpad_max_install_names" def_macosx_bundle='#define CONFIG_MACOSX_BUNDLE 1' @@ -3087,7 +3074,6 @@ LIBSMBCLIENT = $_smb LIBQUVI = $_libquvi LIBTHEORA = $_theora LIRC = $_lirc -MACOSX_FINDER = $_macosx_finder MACOSX_BUNDLE = $_macosx_bundle MNG = $_mng MPG123 = $_mpg123 @@ -3190,7 +3176,6 @@ $def_dl $def_dos_paths $def_iconv $def_macosx_bundle -$def_macosx_finder $def_priority -- cgit v1.2.3