summaryrefslogtreecommitdiffstats
path: root/video/out/mac
Commit message (Collapse)AuthorAgeFilesLines
* mac/common: reuse hidpi window scale frame calculation helperder richter2024-04-041-4/+2
|
* mac/window: cleanup unfsContentFrame usage and make it none optionalder richter2024-04-041-10/+8
|
* mac/window: fix unfs window size retrievalder richter2024-04-042-0/+4
| | | | | | the unfsContentFrame wasn't updated when externally resized leading to a wrong unfs window size afterwards. update it on windowDidResize event when not in fs, not animating and not live resizing.
* mac/view: fix cursor visibility when toggling fullscreender richter2024-03-291-3/+3
| | | | | | | | | | | this broke with the recent refactor of the input handling. one of the edge cases was not considered, where not every mouse down event has a corresponding mouse up event, eg all double clicks or more only have one up event after the first down event. this was handled correctly previously. Fixes #13777
* mac: cleanup swift bridge header imports and unify themder richter2024-03-292-2/+3
|
* mac/log: rename log functions and cleanup classder richter2024-03-293-24/+24
|
* mac: use LogHelper directly instead of mp_logder richter2024-03-291-3/+3
|
* mac/apphub: move menu bar into AppHubder richter2024-03-291-7/+5
|
* mac/apphub: move app icon into AppHubder richter2024-03-291-4/+2
| | | | | split up AppHub header in obj-c and c parts and make it a bidirectional bridging.
* mac: optimise and shorten some codeder richter2024-03-212-11/+5
|
* 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-51/+51
| | | | also optimise option cache setup.
* mac/libmpv: remove mac option handling in favour of option handlerder richter2024-03-211-4/+4
| | | | | | 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-214-63/+35
| | | | gets rid of some unwrapping boilerplate and nil coalescing operators.
* mac/option: make option helper vo struct independentder richter2024-03-211-2/+3
|
* mac/option: move option functionality from mpv helper to option helperder richter2024-03-214-76/+76
| | | | delete now empty mpv helper
* mac/type: move c<>swift type bridging into a dedicated type helperder richter2024-03-211-20/+20
|
* mac/view: optimise drag and drop event handlingder richter2024-03-161-17/+11
|
* mac/input: move scroll wheel event handling into input helperder richter2024-03-161-35/+1
|
* mac/input: optimise mouse movement enabled checkder richter2024-03-161-6/+2
|
* mac/input: move mouse event handling into input helperder richter2024-03-161-47/+12
|
* mac/event: move key event handling to input helper and optimise itder richter2024-03-142-6/+6
|
* mac/events: remove redundant functions and optimise input helper usageder richter2024-03-142-6/+6
| | | | some redundant functions that jump through hoops.
* mac/helper: move input ctx related functionality into new input helperder richter2024-03-143-18/+21
| | | | also make functions thread safe.
* options: remove --focus-on-open and add --focus-onder richter2024-03-101-3/+3
| | | | | | | | | replaces the old focus-on-open option with a more generic focus-on options that can be extended. adjust the only platform that uses that option. Fixes #8337
* mac/menu: add explicit menu type instead of an inferred typeder richter2024-03-071-5/+5
| | | | | 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: rewrite menu bar in swiftder richter2024-03-071-5/+5
|
* mac/vulkan: directly retrieve current render size without cachingder richter2024-03-062-2/+2
| | | | | | the render size cached in ctx->vo->dwidth/dheight can be outdated in some circumstances at the time the context needs resizing. instead use the current render size.
* mac/vulkan: workaround for MoltenVK problem that causes flickerder richter2024-03-061-0/+11
| | | | | | | | | | | | | | | MoltenVK itself tries to work around a supposedly Metal problem that itself causes flicker, black screens or broken rendering. it sets the drawableSize to 1x1 to forcefully complete the presentation. though if 1x1 resolution frame is presented it causes a visual flicker or rather a solid coloured frame. it causes even more problems since sometimes it does not reset the drawableSize to the proper resolution and keeps rendering everything in 1x1. work around this workaround by discarding drawableSize that are <=1 in any direction. Fixes #13505
* cocoa-cb: render on main queue instead of dedicated queueder richter2024-02-291-3/+1
| | | | | | | | | | | initially we drew on a dedicated render queue to circumvent certain bottlenecks on the main queue, like concurrent events that could lead to late drawing. though due to the way cocoa works we need to draw an the main queue otherwise we get undefined behaviour that could lead to crashes. Fixes #10276
* mac/vulkan: set NSView as layer delegate like recommended by MoltenVKder richter2024-02-292-1/+2
|
* mac: set layer content scale on initder richter2024-02-271-0/+2
| | | | | | | | usually the content scale updates automatically, though on init it is possible the wrong scale is used for the initial rendering leading to a wrongly sized surface. properly set the initial content scale of the layer.
* cocoa-cb: lock CGLContext on uninit and manual redrawder richter2024-02-181-0/+10
| | | | | | | | | | | | this fixes a crash on quit, when a CATransaction from a system owned thread/event is happening at the same time. locking the context synchronises these access and prevents the race condition. the draw operation induced by any display call from the CAOpenGLLayer doesn't need that lock, since the display function already does lock that current context. Fixes #11681
* mac: add support for --input-cursor-passthrough optionder richter2023-12-252-0/+5
|
* mac: update geometry/autofit opts on runtimeder richter2023-12-232-8/+14
|
* mac: add support for drag-and-drop optionder richter2023-12-151-2/+2
|
* mac: add support for window-id propertyder richter2023-12-151-0/+7
| | | | returns the NSWindow
* mac: report modifier keys on precise scrollingder richter2023-12-021-1/+1
| | | | | | modifier keys weren't reported when using the trackpad to scroll. Fixes #11195
* mac: fix initial window size and position when already maximizedder richter2023-12-021-1/+2
| | | | | | | | | | | | in the case the window was already set to a maximized size via geometry or related options (100%x100%) the maximize function would try to maximize the window again. this reset the position and slightly increased the size further. to prevent this only maximize on init if we really want to maximize. in the reverse case make a noop call by passing the current zoom state. Fixes #11193
* mac: fix a race condition when updating the window titleder richter2023-11-251-3/+2
| | | | | | | | | | | | | | | | | | | | | | | the title is updated on the main thread (mandatory with cocoa) asynchronously, because otherwise it would either deadlock when done synchronously, lead to undefined behaviour or just crashes. the problem here is that the c string was only copied to an NSString within that asynchronous call, which potentially would access the pointer when it is accessed, modified or freed by another thread. it is only safe to access this pointer as long as the control callback wasn't returned yet. to fix this we move the copying and creation of the String from the c string pointer outside of the asynchronous call where the conversion of an untyped pointer to a typed pointer is done too. since the resulting String is a copy it's safe to be used in the asynchronous call. also reverting ee6ad40, since the problem was most likely an SDK problem or the very same problem as mentioned here. i retested the crash case again und can't reproduce it anymore. using a swift String again instead of an NSSstring. Fixes #12935
* mac: cleanup some unused and unneeded codeder richter2023-11-251-7/+1
|
* mac: title bar fix 1px none covered video at topder richter2023-11-201-1/+1
| | | | | | | | there is 1px border at the top of the window that is not covered by our title bar and the video below is visible. this broke in some newer macOS version even so the calculation of size and position of the title bar is still correct. add 1px the the height of the title bar to cover up the unwanted border.
* mac: fix reporting of left wheel and right wheel scrollingder richter2023-11-201-2/+2
| | | | | | | left wheel and right wheel was swapped. this was copied from the old cocoa backend. a delta <0 is a right scroll, >0 is a left scroll. Fixes #12899
* mac: change display name retrieval to localizedName NSScreen propertyder richter2023-11-101-2/+2
| | | | | | | | | | | | | | | the old displayName property via the IODisplay API is not working anymore on ARM based macs and was broken in at least one other case. instead we use the new localizedName property introduced in 10.15 of the NSScreen. we don't need any backwards compatibility since 10.15 is the oldest version we support now. configs and scripts that use the options and properties fs-screen-name, screen-name or display-names need to be adjusted since the names could differ from the previous implementation via the IODisplay API. Fixes #9697
* mac: remove runtime checks and compatibility for macOS older than 10.15der richter2023-11-094-74/+40
| | | | | we stopped supporting macOS older than 10.15 and hence can remove all the unnecessary runtime checks and compatibility layers.
* meson: remove several macos-10-* build optionsDudemanguy2023-11-091-8/+1
| | | | | | | | | | | These have been build options since the waf build, but that doesn't really make sense. The build can detect whatever macOS sdk version is available and then use that information to determine whether to enable the features or not. Potentially disabling multiple sdk versions doesn't really make any sense. Because f5ca11e12bc55d14bd6895b619c4abfd470c6452 effectively made macOS 10.15 the minimum supported version, we can drop all of these checks and bump the required sdk version to 10.15. The rest of the build simplifies from there.
* vo_gpu/vo_gpu_next: add vulkan support for macOSder richter2023-10-141-0/+43
| | | | | | | | add support for vulkan through metal and a translation layer like MoltenVK. also add the possibility to use different render timing modes for testing. i still consider this experimental atm.
* mac: add a window animation lock to wait for animations to finishder richter2023-10-141-1/+16
| | | | | | | add an animation lock to the window to prevent the window from closing while animating. if this is done while the fs animation is running the dock will stay hidden. this is not used yet, because it's unnecessary for cocoa-cb but will be for new vo backends.
* options: transition options from OPT_FLAG to OPT_BOOLChristoph Heinrich2023-02-213-4/+4
| | | | | | c78482045444c488bb7948305d583a55d17cd236 introduced a bool option type as a replacement for the flag type, but didn't actually transition and remove the flag type because it would have been too much mundane work.
* mac: avoid unnecessary unsafe conversions; fixes crash in debug buildsrcombs2022-09-141-12/+12
| | | | | | | | | | | | | | | Previously, running a debug build of mpv would crash with this output when preinit() at vo_libmpv.c:732 calls control(vo, VOCTRL_PREINIT, NULL): Swift/Optional.swift:247: Fatal error: unsafelyUnwrapped of nil optional This comes from this line of code: var data = UnsafeMutableRawPointer.init(bitPattern: 0).unsafelyUnwrapped Unsafely unwrapping a UnsafeMutableRawPointer.init has always been UB, but the Swift runtime began asserting on it in debug builds a couple macOS versions ago.
* various: fix typosCœur2022-04-253-7/+7
|
* mac: add support for display-width/display-height propertyder richter2021-05-061-13/+20
| | | | | also merge back a helper function that was introduced in commit d3b7732 and for the purpose to be used with the new display res voctrl event.
* mac: fix window geometry calculation on secondary screensder richter2021-04-241-19/+26
| | | | | | | | | | | | | | | this is a regression of af26402, where we changed the geometry calculation to use the visible frame and consider its origin. though the origin is not screen relative but relative to the main screen. the rest of the code expects a screen relative rectangle. because of that windows would be placed out of the screen bounds when not on the main screen. recalculate to origin to be screen relative and use those values for the rest of the calculations. to make the code a bit more comprehensible be a bit more explicit about what is done where with temporary variables and comments. also move the mp_rect calculation that moves the origin and flips the y position to a separate function, so we can reuse it later.
* mac: fix traditional fullscreen on macOS 11der richter2021-02-271-2/+18
| | | | | | | | | | | the fullscreen style mask is not supported on macOS 11 anymore outside of the native fullscreen animation. this can lead to a none working fs or in the worst case a crash. to fix this we will simulate a fullscreen window with a borderless window with the size of the whole screen, though only on macOS 11. Fixes #8490
* mac: remove an unused variableder richter2021-02-271-1/+0
|
* mac: support --on-all-workspaces optionEvgeny Zinoviev2021-02-212-0/+13
|
* mac: fix dangling pointersder richter2021-01-131-28/+17
| | | | | | initialising UnsafeMutableRawPointer the way we did won't free those pointers and we get dangling pointers. explicitly define a scope those pointers are alive and auto freed.
* mac: fix type mismatch Int instead of Int32der richter2020-12-191-1/+1
|
* mac: use visible frame rectangle for window geometry calculationder richter2020-12-191-12/+18
| | | | | | | | | | | | | currently we use the whole screen rectangle to calculate the window geometry. this doesn't take the menu bar or the Dock into account. by default use the visible screen rectangle instead. this is also a change in behaviour, since the window can't be placed outside of this rectangle anymore. also add an option to change to the old behaviour, because it can still be useful in certain cases, like placing the window directly underneath the menu bar when used a desktop background. Fixes #8272
* mac: fix a window positioning bug when exiting fullscreender richter2020-12-192-10/+14
| | | | | | | | | | | | | | | | when exiting fullscreen we set the window frame to a aspect fit frame of the fullscreen frame to prevent aspect ration problems when animating. though that intermediate frame was set too early and before the system knew we already exited the fullscreen. because of that the frame we set could not be properly set and its origin was defaulted to the bottom left corner for exactly one display refresh and only after that the wanted frame was set. this led to a (dark) grey area on the right or top depending on the aspect ratio difference of the screen and video. to prevent this set the intermediate frame in the animation group to make it sync with the system's fullscreen behaviour. Fixes #8371
* mac: support screen-name and fs-screen-name optsder richter2020-12-061-5/+22
| | | | | | | the screen-name and fs-screen-name option allow for specifying screens based on their name. this is the name of the NSScreen and also reported by the VOCTRL_GET_DISPLAY_NAMES event. the old screen and fs-screen options by id, respectively, are preferred over these new ones.
* mac: make focus property observableder richter2020-11-071-0/+32
| | | | | | i missed the VO_EVENT_FOCUS event and the possibility to observe this property and didn't include it in my initial focus commit for that matter.
* mac: add support for the focused propertyder richter2020-09-251-0/+4
|
* mac: add an option to prevent focusing of the window on opender richter2020-09-251-2/+12
| | | | | | | | | on macOS 10.15 setting the activation policy behaves quite weirdly. the call changes the current active App to a nameless process, which probably also the reason that prevents the not focusing to work. a workaround for that, is to refocus the previous active app. Fixes #7725
* mac: add an option to change the App activation policyder richter2020-09-201-1/+18
| | | | useful to hide the app icon in the Dock if necessary.
* mac: add ontop window level for desktopder richter2020-09-201-1/+5
| | | | | | this puts the window ontop of the desktop but behind the desktop icons. Fixes #7791
* mac: add icc profile and ambient light sensor supportder richter2020-08-221-6/+30
| | | | | | this is preparation for new backends. currently this is done via the libmpv API but for future new new VOs not based on libmpv we need these VOCTRL events.
* mac: use config cache und wakeup for mac option runtime changesder richter2020-08-222-9/+48
| | | | | | | | remove the libmpv observer for the macOS specific options and use a config cache + change callback for runtime changes. this is also a preparation for new backends and generalises even more, since libmpv functions can't and shouldn't be used in usual vo backends. for feature parity the config cache is used.
* mac: make ontop level runtime changeableder richter2020-08-221-1/+2
| | | | | | this was requested on an old issue, but the comment has since been deleted. i though it was useful enough to add it. it's also just a one line change.
* mac: properly guard and unwrap an optional valueder richter2020-08-221-8/+12
| | | | | i don't know what i was thinking there, but force unwrapping is a very bad idea.
* cocoa-cb: generalisation of backend independent partsder richter2020-08-225-0/+1965
move all backend independent code parts in their own folder and files, to simplify adding new backends. the goal is to only extend one class and add the backend dependent parts there. usually only the (un)init, config and related parts need to be implemented per backend. furthermore all needed windowing and related events are propagated and can be overwritten. the other backend dependent part is usually the surface for rendering, for example the opengl oder metal layer. in the best case a new backend can be added with only a few hundred lines.