From 193726cd6d31de5ace4803e56cac99594bbd3df6 Mon Sep 17 00:00:00 2001 From: Andreas Neukoetter Date: Tue, 26 Jul 2022 19:00:56 +0200 Subject: [PATCH] Fix get_window_position for multiscreen setups on macOS. (#299) --- src/native/macosx/MacMiniFB.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/native/macosx/MacMiniFB.m b/src/native/macosx/MacMiniFB.m index c310a9d..f20f39e 100644 --- a/src/native/macosx/MacMiniFB.m +++ b/src/native/macosx/MacMiniFB.m @@ -567,8 +567,9 @@ void mfb_get_position(const void* window, int *px, int *py) *px = rectW.origin.x; } if( py != NULL ) { - const NSRect msf = [[NSScreen mainScreen] frame]; - const float height = msf.size.height; + const NSScreen *screen = [win screen]; + const NSRect wsf = [screen frame]; + const float height = wsf.size.height; const float h = rectW.size.height; *py = height - ( rectW.origin.y + h ); // origin is from bottom }