diff --git a/video/out/mac/common.swift b/video/out/mac/common.swift index aac705005f7d3..fc1841afba6bb 100644 --- a/video/out/mac/common.swift +++ b/video/out/mac/common.swift @@ -502,7 +502,9 @@ class Common: NSObject { func windowDidChangeBackingProperties() {} func windowWillStartLiveResize() {} func windowDidEndLiveResize() {} - func windowDidResize() {} + func windowDidResize() { + log.sendWarning("common > windowDidResize") + } func windowDidChangeOcclusionState() {} @objc func control(_ vo: UnsafeMutablePointer, diff --git a/video/out/mac/metal_layer.swift b/video/out/mac/metal_layer.swift index 7cea87c0b4df8..8abb98337aa74 100644 --- a/video/out/mac/metal_layer.swift +++ b/video/out/mac/metal_layer.swift @@ -26,6 +26,8 @@ class MetalLayer: CAMetalLayer { pixelFormat = .rgba16Float backgroundColor = NSColor.black.cgColor + + common.log.sendWarning("MetalLayer > init") } // necessary for when the layer containing window changes the screen diff --git a/video/out/mac/window.swift b/video/out/mac/window.swift index 7b1a858840006..4d0c27fc2d557 100644 --- a/video/out/mac/window.swift +++ b/video/out/mac/window.swift @@ -74,7 +74,7 @@ class Window: NSWindow, NSWindowDelegate { self.init(contentRect: contentRect, styleMask: [.titled, .closable, .miniaturizable, .resizable], backing: .buffered, defer: false, screen: screen) - + common.log.sendWarning("Window > init") // workaround for an AppKit bug where the NSWindow can't be placed on a // none Main screen NSScreen outside the Main screen's frame bounds if let wantedScreen = screen, screen != NSScreen.main { diff --git a/video/out/mac_common.swift b/video/out/mac_common.swift index 349712bf3932c..6e300f85ccc08 100644 --- a/video/out/mac_common.swift +++ b/video/out/mac_common.swift @@ -99,6 +99,7 @@ class MacCommon: Common { } func updateRenderSize(_ size: NSSize) { + log.sendWarning("mac_common > updateRenderSize, \(size)") mpv?.vo.pointee.dwidth = Int32(size.width) mpv?.vo.pointee.dheight = Int32(size.height) flagEvents(VO_EVENT_RESIZE | VO_EVENT_EXPOSE) @@ -155,6 +156,7 @@ class MacCommon: Common { } override func windowDidResize() { + log.sendWarning("mac_common > windowDidResize, \(window.framePixel.size)") guard let window = window else { log.sendWarning("No window available on window resize event") return diff --git a/video/out/vulkan/context_moltenvk.m b/video/out/vulkan/context_moltenvk.m index 56373bff0c9fb..664f8a5e3fdc1 100644 --- a/video/out/vulkan/context_moltenvk.m +++ b/video/out/vulkan/context_moltenvk.m @@ -43,7 +43,8 @@ - (id)initWithContext: (struct ra_ctx*) ctx - (void)layoutSublayersOfLayer: (CALayer*) layer { MP_MSG(_ra_ctx, MSGL_V, "### MetalLayerDelegate > Called layoutSublayersOfLayer\n"); - + + moltenvk_reconfig(_ra_ctx); vo_event(_ra_ctx->vo, VO_EVENT_RESIZE); } @@ -113,6 +114,8 @@ static bool moltenvk_reconfig(struct ra_ctx *ctx) { struct priv *p = ctx->priv; CGSize s = p->layer.drawableSize; + _ra_ctx->vo->pointee.dwidth = s.width; + _ra_ctx->vo->pointee.dheight = s.height; ra_vk_ctx_resize(ctx, s.width, s.height); MP_MSG(ctx, MSGL_V, "Width: %f, Height: %f ### Called resize\n", s.width, s.height); return true;