mirror of
https://github.com/mpv-player/mpv.git
synced 2026-06-06 20:10:30 +00:00
cocoa-cb: move macOS option retrieval to the earliest point possible
moved the retrieval of the macOS specific options from the backend initialisation to the initialisation of the CocoaCB class, the earliest point possible. this way macOS specific options can be used for the opengl context creation for example.
This commit is contained in:
@@ -45,6 +45,12 @@ class MPVHelper: NSObject {
|
||||
mpctx = UnsafeMutablePointer<MPContext>(mp_client_get_core(mpvHandle))
|
||||
inputContext = mpctx!.pointee.input
|
||||
|
||||
if let app = NSApp as? Application {
|
||||
let ptr = mp_get_config_group(mpctx!, mp_client_get_global(mpvHandle),
|
||||
app.getMacOSConf())
|
||||
macOpts = UnsafeMutablePointer<macos_opts>(OpaquePointer(ptr))!.pointee
|
||||
}
|
||||
|
||||
mpv_observe_property(mpvHandle, 0, "ontop", MPV_FORMAT_FLAG)
|
||||
mpv_observe_property(mpvHandle, 0, "border", MPV_FORMAT_FLAG)
|
||||
mpv_observe_property(mpvHandle, 0, "keepaspect-window", MPV_FORMAT_FLAG)
|
||||
|
||||
@@ -61,12 +61,6 @@ class CocoaCB: NSObject {
|
||||
if backendState == .uninitialized {
|
||||
backendState = .needsInit
|
||||
|
||||
if let app = NSApp as? Application {
|
||||
let ptr = mp_get_config_group(mpv.mpctx!, vo.pointee.global,
|
||||
app.getMacOSConf())
|
||||
mpv.macOpts = UnsafeMutablePointer<macos_opts>(OpaquePointer(ptr))!.pointee
|
||||
}
|
||||
|
||||
view = EventsView(cocoaCB: self)
|
||||
view.layer = layer
|
||||
view.wantsLayer = true
|
||||
|
||||
Reference in New Issue
Block a user