Fix get_window_position for multiscreen setups on macOS. (#299)

This commit is contained in:
Andreas Neukoetter 2022-07-26 19:00:56 +02:00 committed by GitHub
parent 3da7b7b22e
commit 193726cd6d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
}