summaryrefslogtreecommitdiffstats
path: root/osdep/mac
Commit message (Collapse)AuthorAgeFilesLines
* cocoa-cb: add support for macOS color space transformation (EDR/HDR)der richter12 days3-1/+45
| | | | | | | | | | by default utilises the color space of the screen on which the window is located. if a specific value is defined, it will instead be utilised. depending on the chosen color space the macOS EDR (HDR) support is activated and that OS's transformation (tone mapping) is used. Fixes #7341
* mac: properly handle regular expressions without force unwrapder richter2024-04-281-2/+3
|
* mac: code cleanup and consistency changes, fix linting issuesder richter2024-04-2814-108/+95
|
* mac/helper: make wakeup callback declaration consistentder richter2024-04-282-4/+6
|
* mac/touchbar: use KVO block API instead of old obj-c instance methodder richter2024-04-281-10/+5
|
* mac/input: add support for dead key reportingder richter2024-04-241-1/+20
| | | | | | | | dead keys like tilde and accents were not reported because they returned an empty string from the NSEvent. try to retrieve dead key with alternative Carbon API when an empty key is reported.
* mac: make display-names unique to allow specific selectionder richter2024-04-241-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | the Screen property localizedName returns a none unique dynamic name that doesn't allow a specific selection of a Screen on every OS boot. the name consists of the vendor name and model name (eg DELL U2723QE). if the same model display is connected to the system several times, macOS starts to add numbers to the localizedName (eg DELL U2723QE (1)), that may not be associated to the same Screen on every OS boot or connecting the display. it also changes the name of the first connected display by adding that numeration. this makes it impossible specify the proper screen with the screen-name option every time. to circumvent this we remove the enumeration from the name and instead add the serial number to the display-names property. this makes the actual Screen unique and none dynamic. furthermore the selection of a screen by name will check for equality for the old localizedName, simple name without enumeration, serial number and the combined name with serial number. this makes it possible to select the screen by either of those names and identifiers, and keeps backwards compatibility with the old behaviour. Examples: localized name (System Settings name): DELL U2723QE, DELL U2723QE (1) simple name: DELL U2723QE serial number: 123456789 combined name: DELL U2723QE (123456789)
* mac/log: fix use after free when freeing mpv handleder richter2024-04-122-2/+8
| | | | | | | | | | | | | | | | | the mp_log is freed when the corresponding mpv_handle (ta_parent) is freed in the EventHelper, though it could still be used from different threads. instead don't use a ta_parent and manually free on manual dereferencing. on app shutdown (memory cleanup) this is not called but instead is freed by the usual cleanup and freeing. the LogHelper is only able to be manually dereferenced in the AppHub, so no race conditions are possible in all other cases (vo).in the AppHub it's impossible to hit a race condition atm, because of how the init process works and how/where the log is used. only manually forcing logging in the exit process itself could theoretically trigger a use after free. Fixes #13823
* mac/vulkan: add support for frame timing via presentation feedbackder richter2024-04-103-3/+61
|
* mac/remote: use event type as key state for proper mapping in functionder richter2024-04-041-4/+3
| | | | | | | instead of using the MP_KEY events (Int32) and using a logical OR to generate a key event for the mpv core, use the cocoa event type for key states and pass those to the the function. in the function we properly map those events to the right MP_KEY events.
* mac/apphub: fix opening several files at once via Finder or App iconder richter2024-04-042-6/+12
| | | | | | | | | | | when dropping more than one file on the App icon or opening via Finder the open(urls:) event might not pass all files at once in the array, but may consecutivly call open(urls:) for each of the files or batched in several arrays. to fix this append any file passed to the open(urls:) event within 0.1 seconds of each other to the current playlist. the first event uses the default behaviour.
* mac/app: add some verbose logging for app startup and file handlingder richter2024-04-012-0/+8
|
* mac/apphub: only instantiate log and option when in Application modeder richter2024-04-011-4/+6
| | | | | | when in libmpv mode there is no need to for logging and reading options. this also prevents possible race conditions with the usage and deinit of the mpv_handler.
* mac/menu: remove redundant quit func and use identical command funcder richter2024-04-011-7/+2
|
* mac/app: cleanup and optimise App launch and terminationder richter2024-04-011-48/+25
| | | | | | | | | | | | 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 #7456
* mac/apphub: move opening url into AppHubder richter2024-04-012-11/+14
|
* mac/app: use new open url App event to simplify open file event handlingder richter2024-04-011-38/+12
| | | | | | | | | | | | | 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.
* mac/log: fallback to system logger if no mp_log is yet availableder richter2024-04-012-1/+18
| | | | | | | | | | 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.
* mac/app: rewrite App c main function, startup and termination in swiftder richter2024-04-018-200/+95
| | | | | also move main invocation into AppHub and completely delete the old Application c implementation.
* mac/app: rewrite Application class in swiftder richter2024-04-013-99/+106
|
* mac: cleanup swift bridge header imports and unify themder richter2024-03-2911-65/+48
|
* mac/apphub: make DnD behaviour on bundle icon configurableder richter2024-03-291-0/+3
| | | | | we just need to add a OptionHelper to the AppHub, options were already tried to read from the optional OptionHelper.
* mac/log: rename log functions and cleanup classder richter2024-03-293-17/+17
|
* mac: use LogHelper directly instead of mp_logder richter2024-03-291-2/+2
|
* mac: rename mpvHandle to mpvder richter2024-03-292-9/+9
|
* mac: remove now unnecessary objective-c forwardingder richter2024-03-294-8/+7
|
* mac/apphub: move cocoa-cb into AppHubder richter2024-03-293-21/+9
|
* mac/apphub: move menu bar into AppHubder richter2024-03-294-11/+11
|
* mac/app: remove unused Application flagder richter2024-03-291-6/+0
|
* mac/apphub: move mac options into AppHubder richter2024-03-298-85/+91
|
* mac/apphub: move app icon into AppHubder richter2024-03-298-20/+44
| | | | | split up AppHub header in obj-c and c parts and make it a bidirectional bridging.
* mac: cleanup mac headers and include preprocessorsder richter2024-03-293-12/+2
|
* mac/event: only initialise an EventHelper when necessaryder richter2024-03-242-4/+12
|
* mac/touchbar: use AppHub directly instead of the singletonder richter2024-03-241-2/+3
|
* mac/remote: use AppHub directly instead of the singletonder richter2024-03-241-2/+3
|
* mac/touchbar: use EventHelper for event handlingder richter2024-03-244-66/+22
| | | | also remove remaining old event handling.
* mac/touchbar: move touch bar into AppHubder richter2024-03-242-1/+7
|
* mac/remote: use EventHelper for event handlingder richter2024-03-242-50/+37
|
* mac/touchbar: fix devision by 0der richter2024-03-241-1/+1
|
* mac/remote: fix devision by 0der richter2024-03-241-1/+1
|
* cocoa-cb: use EventHelper for event handlingder richter2024-03-242-18/+11
|
* cocoa-cb: use a separate mpv_handle for cocoa-cb to simplify shutdownder richter2024-03-243-22/+12
|
* mac/apphub: migrate remaining events functionality to new AppHubder richter2024-03-2410-219/+161
| | | | | | | | add new app_bridge objc file for bridging between mpv core and app functionality. replace old EventsResponder singleton with AppHub. another step to clean up all App functionality and have one central place for it.
* mac/event: add helper to subscribe to mpv events and property changesder richter2024-03-242-0/+166
| | | | | preparation to remove duplicate code from all classes that implement their own observer loops.
* mac/libmpv: remove unused functionsder richter2024-03-211-37/+0
|
* mac/option: remove now unused computed option variablesder richter2024-03-211-1/+0
|
* mac/option: rename option structs to properly represent their contentder richter2024-03-214-35/+29
| | | | also optimise option cache setup.
* mac/libmpv: remove mac option handling in favour of option handlerder richter2024-03-211-14/+0
| | | | | | since the option handler is not optional anymore and available on init in cocoa-cb we don't need to duplicate this functionality in libmpv anymore.
* mac/option: make option helper none optionalder richter2024-03-211-1/+1
| | | | gets rid of some unwrapping boilerplate and nil coalescing operators.
* mac/option: make option helper vo struct independentder richter2024-03-211-6/+3
|
* mac/option: optimise option pointer accessder richter2024-03-211-3/+4
|
* mac/option: remove unused and obsolete variablesder richter2024-03-211-6/+1
|
* mac/option: move option functionality from mpv helper to option helperder richter2024-03-213-8/+8
| | | | delete now empty mpv helper
* mac/type: move c<>swift type bridging into a dedicated type helperder richter2024-03-216-70/+88
|
* mac/touchbar: simplify item and view creationder richter2024-03-181-70/+53
|
* mac/touchbar: optimise time item updateder richter2024-03-181-6/+3
|
* mac/touchbar: optimise constraint calculationder richter2024-03-181-5/+3
|
* mac/touchbar: use DateComponentsFormatter for time formattingder richter2024-03-181-9/+5
|
* mac/touchbar: simplify update items logicder richter2024-03-181-27/+8
|
* mac/touchbar: take playback speed into account for rate limitingder richter2024-03-181-1/+4
|
* mac/touchbar: rewrite touch bar in swiftder richter2024-03-184-397/+344
|
* mac/input: optimise scroll wheel event handlingder richter2024-03-161-35/+18
|
* mac/input: move scroll wheel event handling into input helperder richter2024-03-161-5/+40
|
* mac/input: optimise mouse movement enabled checkder richter2024-03-161-2/+3
|
* mac/input: fix switched mouse forward and back buttonder richter2024-03-161-2/+2
|
* mac/input: move mouse event handling into input helperder richter2024-03-161-0/+28
|
* mac/input: add missing special keysder richter2024-03-141-0/+2
|
* mac/input: add simplified mp_keymap initder richter2024-03-142-52/+32
|
* mac/input: remove wrongly mapped modifier keysder richter2024-03-141-3/+0
|
* mac/event: move key event handling to input helper and optimise itder richter2024-03-147-165/+128
|
* mac/input: define AltGr mask as static NSEvent.ModifierFlags variableder richter2024-03-142-2/+8
| | | | | this makes it possible to properly test for those modifiers in a proper swift like way.
* mac/events: remove redundant functions and optimise input helper usageder richter2024-03-1410-109/+29
| | | | some redundant functions that jump through hoops.
* mac/helper: move input ctx related functionality into new input helperder richter2024-03-143-95/+76
| | | | also make functions thread safe.
* mac/events: move input ctx related functionality into new input helperder richter2024-03-143-31/+79
| | | | | preparation for mac/events cleanup and single responsibility principle. all functions are thread safe.
* mac/menu: add explicit menu type instead of an inferred typeder richter2024-03-071-45/+49
| | | | | with the use of an explicit type we can removed inferred type checks like separators/services menu by name or menus by sub configs.
* mac/menu: make menu creation recursive to allow nested submenusder richter2024-03-071-31/+31
| | | | also makes menu creation cleaner and more obvious.
* mac/menu: move conditional Bundle menu items into configder richter2024-03-071-11/+6
| | | | | | only add the "Show log Fileā€¦" menu item config when invoked from the bundle, instead of testing on menu item creation. this is similar to the touch bar menu items now.
* mac/menu: keep track of menu items with dynamic actionsder richter2024-03-071-14/+8
| | | | | | keeping track of the dynamic menu items lets us directly access them by key. we don't need to search in the config array for the right config and menu item.
* mac/menu: merge file and url config propertiesder richter2024-03-071-15/+11
| | | | | a file path is basically an URL. both are also handled as URL objects in our code.
* mac/menu: properly guard playlist array accessder richter2024-03-071-2/+2
|
* mac/menu: attach menu config to menu item for direct accessder richter2024-03-071-27/+21
| | | | | add a config property to the menu items, so we don't need to search in the config array for the right config.
* mac/menu: replace app.command usage with event.commandder richter2024-03-071-2/+2
|
* mac/menu: fix touch bar menu itemder richter2024-03-071-6/+0
| | | | | | the check broke when the runtime check was removed, eg the menu item was never added to the menu. since we only add the menu item to the config when touch bar support is available the check is completely unnecessary.
* mac/menu: rename Preferences to Settings for consistency with macOSder richter2024-03-071-4/+4
|
* mac/menu: remove duplicate key assignment Undo/Zoomder richter2024-03-071-1/+1
| | | | this key is already assigned to Undo.
* mac/menu: optimise loading files functionder richter2024-03-071-7/+3
| | | | don't save files in a temporary array and use an in place mapping.
* mac/menu: replace deprecated openFile() usageder richter2024-03-071-8/+8
|
* mac/menu: remove unnecessary alert config fields and alertder richter2024-03-071-43/+10
| | | | | | | the config folder is created by mpv if it does not exist, so the last alert is unnecessary. also change config path priority.
* mac/menu: rewrite menu bar in swiftder richter2024-03-078-910/+472
|
* mac/app: remove unused functionder richter2024-03-072-7/+0