Skip to content

Commit

Permalink
more logs and trying one thing
Browse files Browse the repository at this point in the history
  • Loading branch information
themisterholliday committed Mar 1, 2024
1 parent 2468054 commit eb797ca
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
4 changes: 3 additions & 1 deletion video/out/mac/common.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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<vo>,
Expand Down
2 changes: 2 additions & 0 deletions video/out/mac/metal_layer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion video/out/mac/window.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 2 additions & 0 deletions video/out/mac_common.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion video/out/vulkan/context_moltenvk.m
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit eb797ca

Please sign in to comment.