aboutsummaryrefslogtreecommitdiffhomepage
path: root/osdep/macosx_application.m
Commit message (Collapse)AuthorAge
* {mac,cocoa}: trim trailing null out of macosx_icon when loading itGravatar Rodger Combs2018-10-02
| | | | | | This prevents crashes when loading the application icon image. Suggested-by: Akemi <der.richter@gmx.de>
* cocoa-cb: add Apple Software Renderer supportGravatar Akemi2018-09-30
| | | | | | by default the pixel format creation falls back to software renderer when everything fails. this is mostly needed for VMs. additionally one can directly request an sw renderer or exclude it entirely.
* cocoa-cb: remove pre-allocation of window, view and layerGravatar Akemi2018-06-12
| | | | | | | | | | | the pre-allocation was needed because the layer allocated a opengl context async itself and we couldn't influence that. so we had to start the core after the context was actually allocated. furthermore a window, view and layer hierarchy had to be created so the layer would create a context. now, instead of relying on the layer to create a context we do this manually and re-use that context later when the layer wants to create one async itself.
* cocoa-cb: make fullscreen resize animation duration configurableGravatar Akemi2018-02-28
|
* cocoa-cb: change border and borderless window stylingGravatar Akemi2018-02-28
| | | | | | | | | | | the title bar is now within the window bounds instead of outside. same as QuickTime Player. it supports several standard styles, two dark and two light ones. additionally we have properly rounded corners now and the borderless window also has the proper window shadow. Also make the earliest supported macOS version 10.10. Fixes #4789, #3944
* cocoa-cb: initial implementation via opengl-cb APIGravatar Akemi2018-02-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this is meant to replace the old and not properly working vo_gpu/opengl cocoa backend in the future. the problems are various shortcomings of Apple's opengl implementation and buggy behaviour in certain circumstances that couldn't be properly worked around. there are also certain regressions on newer macOS versions from 10.11 onwards. - awful opengl performance with a none layer backed context - huge amount of dropped frames with an early context flush - flickering of system elements like the dock or volume indicator - double buffering not properly working with a none layer backed context - bad performance in fullscreen because of system optimisations all the problems were caused by using a normal opengl context, that seems somewhat abandoned by apple, and are fixed by using a layer backed opengl context instead. problems that couldn't be fixed could be properly worked around. this has all features our old backend has sans the wid embedding, the possibility to disable the automatic GPU switching and taking screenshots of the window content. the first was deemed unnecessary by me for now, since i just use the libmpv API that others can use anyway. second is technically not possible atm because we have to pre-allocate our opengl context at a time the config isn't read yet, so we can't get the needed property. third one is a bit tricky because of deadlocking and it needed to be in sync, hopefully i can work around that in the future. this also has at least one additional feature or eye-candy. a properly working fullscreen animation with the native fs. also since this is a direct port of the old backend of the parts that could be used, though with adaptions and improvements, this looks a lot cleaner and easier to understand. some credit goes to @pigoz for the initial swift build support which i could improve upon. Fixes: #5478, #5393, #5152, #5151, #4615, #4476, #3978, #3746, #3739, #2392, #2217
* osx: code cleanups and cosmetic fixesGravatar Akemi2018-01-20
|
* osx: fix the bundle $PATH yet againGravatar Akemi2017-11-11
| | | | we have 5 parameters for the string but only 4 were being used.
* osx: add right MacPorts paths to our bundle $PATHGravatar Akemi2017-10-07
| | | | also add another path for homebrew.
* osx: add some common paths to our $PATH when started from bundleGravatar Akemi2017-10-03
| | | | | | | | | | | with the previous commit we removed the ability of loading the standard shell environment. this exact behaviour can only be re-added by either invoking the standard shell in a background process and reading it's environment vars or by manually reading all the various shell configs. both ways are kinda dirty and the former was already rejected before. for now we will just add some commonly used paths, when started from the bundle, so it can find the binaries used by mpv again. for example the youtube-dl one for our youtube-dl hook.
* osx: fix bundle on macOS High Sierra (10.13)Gravatar Akemi2017-10-03
| | | | | | | | | | | | | | | | | | | | | | Apple slightly changed the App bundle mechanism which broke wrapper scripts that invoke the actual binary. it caused the bundle to always open a new instance of mpv instead of reusing the currently running one. just removing the wrapper script would lead to several regressions, so it was replaced with a symlink to the bundle binary. detection if mpv was started from the bundle was replaced by comparing the execution name of the binary, eg the name of the symlink "mpv-bundle". additionally, because we load a standard config from the Resources folder of the bundle again, we prevent that config from being loaded if mpv wasn't started via the bundle. the psn argument has to be removed manually again. the ability of loading your standard shell environment has been removed with the wrapper. a substitution will be added with another commit. as a side effect this fixes an issues when zsh was used with common NodeJS configuration scripts. Fixes #4926 #4866
* 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