Author: manolo
Date: 2012-06-14 05:41:19 -0700 (Thu, 14 Jun 2012)
New Revision: 9602
Log:
Mac OS: added necessary fl_open_display() in Fl::y() and 
Fl_X::screen_work_area() functions.

Modified:
   branches/branch-1.3/src/Fl_cocoa.mm

Modified: branches/branch-1.3/src/Fl_cocoa.mm
===================================================================
--- branches/branch-1.3/src/Fl_cocoa.mm 2012-06-14 08:51:57 UTC (rev 9601)
+++ branches/branch-1.3/src/Fl_cocoa.mm 2012-06-14 12:41:19 UTC (rev 9602)
@@ -1324,6 +1324,7 @@
  * smallest y coordinate in screen space of work area of menubar-containing 
display
  */
 int Fl::y() {
+  fl_open_display();
   NSRect visible = [[[NSScreen screens] objectAtIndex:0] visibleFrame];
   return int(main_screen_height - (visible.origin.y + visible.size.height));
 }
@@ -1347,11 +1348,12 @@
 // computes the work area of the nth screen (screen #0 has the menubar)
 void Fl_X::screen_work_area(int &X, int &Y, int &W, int &H, int n)
 {
-    NSRect r = [[[NSScreen screens] objectAtIndex:n] visibleFrame];
-    X   = int(r.origin.x);
-    Y   = main_screen_height - int(r.origin.y + r.size.height);
-    W   = int(r.size.width);
-    H   = int(r.size.height);
+  fl_open_display();
+  NSRect r = [[[NSScreen screens] objectAtIndex:n] visibleFrame];
+  X   = int(r.origin.x);
+  Y   = main_screen_height - int(r.origin.y + r.size.height);
+  W   = int(r.size.width);
+  H   = int(r.size.height);
 }
 
 /*

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to