Mac OS: added necessary fl_open_display() in Fl::y() and Fl_X::screen_work_area() functions.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9602 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2012-06-14 12:41:19 +00:00
parent 25bfd177ef
commit c0e01b24da

@ -1324,6 +1324,7 @@ int Fl::x() {
* smallest y coordinate in screen space of work area of menubar-containing display * smallest y coordinate in screen space of work area of menubar-containing display
*/ */
int Fl::y() { int Fl::y() {
fl_open_display();
NSRect visible = [[[NSScreen screens] objectAtIndex:0] visibleFrame]; NSRect visible = [[[NSScreen screens] objectAtIndex:0] visibleFrame];
return int(main_screen_height - (visible.origin.y + visible.size.height)); return int(main_screen_height - (visible.origin.y + visible.size.height));
} }
@ -1347,11 +1348,12 @@ int Fl::h() {
// computes the work area of the nth screen (screen #0 has the menubar) // 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) void Fl_X::screen_work_area(int &X, int &Y, int &W, int &H, int n)
{ {
NSRect r = [[[NSScreen screens] objectAtIndex:n] visibleFrame]; fl_open_display();
X = int(r.origin.x); NSRect r = [[[NSScreen screens] objectAtIndex:n] visibleFrame];
Y = main_screen_height - int(r.origin.y + r.size.height); X = int(r.origin.x);
W = int(r.size.width); Y = main_screen_height - int(r.origin.y + r.size.height);
H = int(r.size.height); W = int(r.size.width);
H = int(r.size.height);
} }
/* /*