From c8cc203735d73f62def2692d1027f45ac10c03db Mon Sep 17 00:00:00 2001 From: der richter Date: Sat, 30 Nov 2019 23:47:52 +0100 Subject: cocoa-cb: use m_config_cache and new VOCTRL for option handling this removes the direct access of the mp_vo_opts stuct via the vo struct and replaces it with the m_config_cache usage. this updates the fullscreen and window-minimized property via m_config_cache_write_opt instead of the old mechanism via VOCTRL and event flagging. also use the new VOCTRL_VO_OPTS_CHANGED event for fullscreen and border changes. --- video/out/cocoa-cb/window.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'video/out/cocoa-cb/window.swift') diff --git a/video/out/cocoa-cb/window.swift b/video/out/cocoa-cb/window.swift index 1ac0e2bc78..48f3210a22 100644 --- a/video/out/cocoa-cb/window.swift +++ b/video/out/cocoa-cb/window.swift @@ -182,7 +182,7 @@ class Window: NSWindow, NSWindowDelegate { func windowDidEnterFullScreen(_ notification: Notification) { isInFullscreen = true - cocoaCB.flagEvents(VO_EVENT_FULLSCREEN_STATE) + cocoaCB.mpv?.setConfigProperty(fullscreen: isInFullscreen) cocoaCB.updateCusorVisibility() endAnimation(frame) cocoaCB.titleBar?.show() @@ -191,7 +191,7 @@ class Window: NSWindow, NSWindowDelegate { func windowDidExitFullScreen(_ notification: Notification) { guard let tScreen = targetScreen else { return } isInFullscreen = false - cocoaCB.flagEvents(VO_EVENT_FULLSCREEN_STATE) + cocoaCB.mpv?.setConfigProperty(fullscreen: isInFullscreen) endAnimation(calculateWindowPosition(for: tScreen, withoutBounds: targetScreen == screen)) cocoaCB.view?.layerContentsPlacement = .scaleProportionallyToFit } @@ -474,11 +474,11 @@ class Window: NSWindow, NSWindowDelegate { } func windowDidMiniaturize(_ notification: Notification) { - cocoaCB.flagEvents(VO_EVENT_WIN_STATE) + cocoaCB.mpv?.setConfigProperty(minimized: true) } func windowDidDeminiaturize(_ notification: Notification) { - cocoaCB.flagEvents(VO_EVENT_WIN_STATE) + cocoaCB.mpv?.setConfigProperty(minimized: false) } func windowDidResignKey(_ notification: Notification) { -- cgit v1.2.3