# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1325123639 0 # Node ID def1ca619ba28cb9ab9baae82539e3fb73f7174b # Parent 50d972da558e52c336f4858cd861eb9d507167c8 Use the screen of the window when possible on Mac instead of the main screen. This should help with multi-monitor configurations. diff -r 50d972da558e -r def1ca619ba2 mac/dw.m --- a/mac/dw.m Wed Dec 28 22:49:26 2011 +0000 +++ b/mac/dw.m Thu Dec 29 01:53:59 2011 +0000 @@ -8527,6 +8527,7 @@ { int horz = DW_POINTER_TO_INT(dw_window_get_data(handle, "_dw_grav_horz")); int vert = DW_POINTER_TO_INT(dw_window_get_data(handle, "_dw_grav_vert")); + id object = handle; /* Do any gravity calculations */ if(horz || (vert & 0xf) != DW_GRAV_BOTTOM) @@ -8552,8 +8553,8 @@ /* Adjust the values to avoid Dock/Menubar if requested */ if((horz | vert) & DW_GRAV_OBSTACLES) { - NSRect visiblerect = [[NSScreen mainScreen] visibleFrame]; - NSRect totalrect = [[NSScreen mainScreen] frame]; + NSRect visiblerect = [[object screen] visibleFrame]; + NSRect totalrect = [[object screen] frame]; if(horz & DW_GRAV_OBSTACLES) { @@ -8646,7 +8647,7 @@ if(x) *x = rect.origin.x; if(y) - *y = [[NSScreen mainScreen] frame].size.height - rect.origin.y - rect.size.height; + *y = [[window screen] frame].size.height - rect.origin.y - rect.size.height; if(width) *width = rect.size.width; if(height)