From 5abe4678c168ee4f8b1d4341e7f63ac5d8a679a9 Mon Sep 17 00:00:00 2001 From: Andrew Owens Date: Wed, 25 Feb 2026 12:31:47 -1000 Subject: [PATCH] highgui(cocoa): fix moveWindow Y conversion when Dock is visible --- modules/highgui/src/window_cocoa.mm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/highgui/src/window_cocoa.mm b/modules/highgui/src/window_cocoa.mm index f14b45dab1..d68b20bd40 100644 --- a/modules/highgui/src/window_cocoa.mm +++ b/modules/highgui/src/window_cocoa.mm @@ -244,7 +244,8 @@ CV_IMPL void cvShowImage( const char* name, const CvArr* arr) int y = [window y0]; if(x >= 0 && y >= 0) { - y = [[window screen] visibleFrame].size.height - y; + NSRect visibleFrame = [[window screen] visibleFrame]; + y = NSMaxY(visibleFrame) - y; [window setFrameTopLeftPoint:NSMakePoint(x, y)]; } } @@ -285,7 +286,8 @@ CV_IMPL void cvMoveWindow( const char* name, int x, int y) [window setY0:y]; } else { - y = [[window screen] visibleFrame].size.height - y; + NSRect visibleFrame = [[window screen] visibleFrame]; + y = NSMaxY(visibleFrame) - y; [window setFrameTopLeftPoint:NSMakePoint(x, y)]; } }