aboutsummaryrefslogtreecommitdiffhomepage
path: root/osdep/macosx_application.m
Commit message (Collapse)AuthorAge
* osx: fix media keys input when other Apps steal the priorityGravatar Akemi2017-09-07
| | | | | | | | | | | other Apps do the same as mpv and tap into the global event chain. events that are handled are not being propagated down the event chain. that can lead to mpv not getting any media key events anymore when they are held back by other Apps. we will just move mpv back to the top of the event list when mpv is refocused and is not at the top of the list any more. Fixes #4834
* osx: refactor menu bar creationGravatar Akemi2017-08-18
| | | | | make the menu bar look more like a standard macOS menu bar, with all the standard menu items like About, Help, Open, etc.
* osx: move menu bar creation into its own fileGravatar Akemi2017-08-18
|
* osx: change license of OSX and cocoa files to LGPLGravatar wm42017-06-24
| | | | All authors of the current code have agreed.
* osx: fix Touch Bar access on systems without Touch Bar supportGravatar Akemi2017-04-02
| | | | | | when building with a deployment target older than an SDK with Touch Bar support we still tried to access the TouchBar, since the compile time checks are positive. to prevent this we add two runtime checks.
* osx: fix key input in certain circumstancesGravatar Akemi2017-03-26
| | | | | | | | | | | | | for a reason i can just assume some key events can vanish from the event chain and mpv seems unresponsive. after quite some testing i could confirm that the events are present at the first entry point of the event chain, the sendEvent method of the Application, and that they vanish at a point afterwards. now we use that entry point to grab keyDown and keyUp events. we also stop propagating those key events to prevent the no key input' error sound. if we ever need the key events somewhere down the event chain we need to start propagating them again. though this is not necessary currently.
* osx: initial Touch Bar supportGravatar Akemi2017-03-26
|
* osx: improve bundle handlingGravatar Akemi2017-02-16
| | | | | | | | | | | | | | | | | we have two problems here. first when mpv is started from the bundle it uses its own environment variables and possibly can't find for example the youtube-dl binary for our youtube-dl hook. second we couldn't reliable determine when mpv was started from the bundle, which led to the pseudo-gui usage even when the binary was invoked from a shell. to prevent this we will wrap the bundle binary with a shell script, which will only be called when we start mpv from the bundle. this way we can get the same environment variables, like $PATH, for our bundle and additional we can set the pseudo-gui only when started through this script. it is also possible to detect the bundle usage properly and accurately through the usage of another environment var. Fixes #2061
* cocoa: gracefully quit from the Dock's context menuGravatar Akemi2017-02-16
| | | | | | | | | | | | quitting mpv from the Dock's context menu leaves the shell in a bad state where you can't see your input any more and other weirdnesses. in a big refactor (afdc9c4) the method to handle this case was actually copied over but the the code to register the event itself was removed or forgotten by accident, leaving some lines of dead code. i re-added the event and slightly adjusted the function. the function was slightly changed so the head of it is consistent with our other events and it is associated with this commit and functionality in the future.
* cocoa: cosmetic fixesGravatar Akemi2016-12-16
|
* osx: update the menu and remove conflicting itemGravatar Akemi2016-12-12
| | | | | | | | | | | Remove 'Quit mpv & remember playback position' from the menu because it conflicts with the global logout shortcut. add separator between 'Hide' and 'Quit' for consistency with other Apps. also rename the 'Movie' menu to 'Video'. it's a bit more generic. Fixes #3865
* Use - as command-name separator everywhereGravatar Timotej Lazar2016-07-14
| | | | | | | Old-style commands using _ as separator (e.g. show_progress) were still used in some places, including documentation and configuration files. This commit updates all such instances to the new style (show-progress) so that commands are easier to find in the manual.
* mpv_talloc.h: rename from talloc.hGravatar Dmitrij D. Czarkoff2016-01-11
| | | | This change helps avoiding conflict with talloc.h from libtalloc.
* osx: never expose input_ctx from EventsResponderGravatar wm42015-05-26
| | | | Keep it internal, so we can synchronize access to it properly.
* build: move main-fn files to osdepGravatar wm42015-05-02
| | | | | | And split the Cocoa and Unix cases. Simplify the Cocoa case slightly by calling mpv_main directly, instead of passing a function pointer. Also add a comment explaining why Cocoa needs a special case at all.
* cocoa: always compile OSX application code with cocoaGravatar wm42015-05-02
| | | | | | | | | | | | | | This unbreaks compiling command line player and libmpv at the same time. The problem was that doing so silently disabled the OSX application thing - but the command line player can not use the vo_opengl Cocoa backend without it. The OSX application code is basically dead in libmpv, but it's not that much code anyway. If you want a mpv binary that does not create an OSX application singleton (and creates a menu etc.), you must disable cocoa completely, as cocoa can't be used anyway in this case.
* Update license headersGravatar Marcin Kurczewski2015-04-13
| | | | Signed-off-by: wm4 <wm4@nowhere>
* osx: terminate argv properly when arguments are removedGravatar wm42015-03-06
| | | | | | | The player now relies on the (slightly obscure) requirement that argv is NULL-terminated. Might fix #1652.
* cocoa: remove unused functionGravatar Stefano Pigozzi2015-02-14
|
* cocoa: fix exiting the command line playerGravatar wm42015-02-13
| | | | | | | | Commit e920a00eb assumed that terminate_cocoa_application() actually would exit. But apparently that is not always the case; e.g. mpv --help will just hang. The old code had a dummy exit(0), which was apparently actually called. Fix by explicitly exiting if mpv_main() returns and terminate_cocoa_application() does nothing.
* osx: move cocoa specific call out of common codeGravatar wm42015-02-12
| | | | This is almost equivalent, and gets rid of the ifdef.
* cocoa: ignore first file open events from command lineGravatar Stefano Pigozzi2014-12-07
| | | similar to some of the code deleted in 685b8b7a but simpler
* cocoa: use --idle when running inside bundleGravatar Stefano Pigozzi2014-12-06
| | | | | Previously when using the bundle we used a custom bizarro thing to wait for events. Just use `--idle` and greatly simplify the code.
* cocoa: don't create Dock icon for audio only filesGravatar Stefano Pigozzi2014-12-05
| | | | fixes #635
* cocoa: remove urlencoding for url open eventsGravatar Stefano Pigozzi2014-12-02
| | | | | | This fixes using the mpv:// custom protocol on Yosemite were apparently we receive an url which is automatically urlencoded by the system. /cc mpv-player/stable
* Set thread name for debuggingGravatar wm42014-10-19
| | | | | | | | | | Especially with other components (libavcodec, OSX stuff), the thread list can get quite populated. Setting the thread name helps when debugging. Since this is not portable, we check the OS variants in waf configure. old-configure just gets a special-case for glibc, since doing a full check here would probably be a waste of effort.
* cocoa: move handleFilesArray: to macosx_eventsGravatar FRAU KOUJIRO2014-08-06
|
* cocoa: move set_input_context to macosx_eventsGravatar FRAU KOUJIRO2014-08-06
|
* cocoa: sync inputContext inside EventsResponderGravatar FRAU KOUJIRO2014-08-06
|
* cocoa: decouple events from application somewhatGravatar FRAU KOUJIRO2014-08-06
|
* cocoa: fix key equivalent dispatchingGravatar Stefano Pigozzi2014-07-30
| | | | | | | | | | Prior to this commit we had a list of key modifiers and checked against that. Actually, the Cocoa framework has a built in way to do it and it involves calling performKeyEquivalent: on the menu instance. Fixes #946 cc @mpv-player/stable: this should apply with no conflicts
* cocoa: fix deadlock during initialization [2]Gravatar Stefano Pigozzi2014-02-13
| | | | Fixup commit for 20fa191ad.
* cocoa: fix deadlock during initializationGravatar Stefano Pigozzi2014-02-13
| | | | | | Thanks to @wm4 for catching the bug. Fixes #405
* cocoa: sort files opened from Finder the same way Finder doesGravatar Bilal Syed Hussain2014-01-20
| | | | Fixes #497
* cocoa: add application icon to the Dock when run from CLIGravatar Stefano Pigozzi2014-01-14
| | | | | | | | | | Application icon was added to the Dock only when run inside of a bundle. That was handled automatically by OS X using the Info.plist definition. To add the Application icon when run as a CLI program, I used the samme approach in the X11 code and loaded the icon as a static binary blob inside of mpv's binary. This is the simplest approach as it avoid headackes when relocating the binary and such.
* cocoa: refactor files drag and drop on the Dock iconGravatar Stefano Pigozzi2014-01-04
| | | | | Use the newly added `mp_event_drop_files` core function instead of having logic in the platform dependent code.
* macosx_application: replace mp_msg with stderr for semi-fatal errorGravatar wm42013-12-21
| | | | Apparently this should never be run anyway.
* Fix OSX build; remove all remaining mpvcore referencesGravatar 11rcombs2013-12-17
|
* cocoa: fix opening quarantined files on 10.9 with the bundle [2]Gravatar Stefano Pigozzi2013-10-25
| | | | Fixup commit for bbc146927
* cocoa: fix opening quarantined files on 10.9 with the bundleGravatar Stefano Pigozzi2013-10-24
| | | | | | | It looks like on Mavericks the Finder is passing different arguments to mpv depending on whether the opened file is quarantined or not. Fixes #285
* cocoa: fix race condition with input context creationGravatar Stefano Pigozzi2013-10-24
| | | | | | | | | | This seems to be a problem only in OS X 10.9. I guess they improved the general speed of the Cocoa startup and suddenly mpv core takes more time than the Cocoa thread to initialize. Fixes #285 (hopefully!)
* osx: fix buildGravatar wm42013-09-27
| | | | | | Or at least I hope it fixes it, since I can't test. Broken by commit 0d90dd0.
* macosx_application: fix regression causing crashGravatar Stefano Pigozzi2013-09-19
| | | | | 95a2151d1 introduced a crash on systems lower than 10.9 when opening files with a single argument.
* macosx_application: remove deprecation warning on OS X 10.9Gravatar Nyx0uf2013-09-16
| | | | | | | | | | | | GetCurrentProcess() is deprecated on 10.9. Make a universal solution by checking OS version number. get_system_version() function is the recommended Apple way of getting the OS version, since Gestalt is also deprecated (and does pretty much the same thing anyway) Updating HIDRemote.m to use a similar function would allow to get rid of the 2 other warnings.
* macosx_application: fix file opening on 10.9 (for real this time)Gravatar Stefano Pigozzi2013-09-13
| | | | | | | | I did commit 86c05655d by thinking `mpv` already removed the `mpv` from argc/argv. It actually is still there, so the argc must be 1 to check for no arguments. Thanks to @Nyx0uf for pointing out the bug and for testing on 10.9!
* macosx_application: fix file opening on OS X 10.9 (hopefully)Gravatar Stefano Pigozzi2013-09-12
| | | | | | | | File opening through Finder, apparently drops `--psn` arguments on Mavericks and just uses no args. Modify the code to account for that case. This wasn't tested on 10.9 itself (I don't have a paid dev account), but it *should* work if I understood the problem correctly.
* macosx_application: handle mpv:// linksGravatar Stefano Pigozzi2013-09-07
| | | | | | | Pretty useful for people writing userscripts for web browsers. Links starting with 'mpv://' are forwarded to the mpv OSX bundle. The leading 'mpv://' is stripped from the recived url and the rest of the string is inserted as is in the playlist.
* macosx_application: handle URL events as fileopen eventsGravatar Stefano Pigozzi2013-09-07
| | | | | This allows to open URLs directly with mpv. This is useful for streaming and libquvi supported sites.
* cocoa: let the core handle key repeatsGravatar Stefano Pigozzi2013-08-30
| | | | | Report key down and key up modifiers to the core so that it can issue it's own key repeats (instead of relying on Cocoa's ones).
* macosx: remove platform specific input queueGravatar Stefano Pigozzi2013-08-13
| | | | | Since last commit the input queue in the core is thread safe, so there is no need for all this platform specific stuff anymore.