changeset 1513:def1ca619ba2

Use the screen of the window when possible on Mac instead of the main screen. This should help with multi-monitor configurations.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Thu, 29 Dec 2011 01:53:59 +0000
parents 50d972da558e
children f33dca736917
files mac/dw.m
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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)