Author: matt
Date: 2011-05-26 06:48:00 -0700 (Thu, 26 May 2011)
New Revision: 8738
Log:
#2646: improved queries for screen sizes.
Modified:
branches/branch-1.3/src/screen_xywh.cxx
Modified: branches/branch-1.3/src/screen_xywh.cxx
===================================================================
--- branches/branch-1.3/src/screen_xywh.cxx 2011-05-24 20:17:48 UTC (rev
8737)
+++ branches/branch-1.3/src/screen_xywh.cxx 2011-05-26 13:48:00 UTC (rev
8738)
@@ -219,6 +219,11 @@
}
}
}
+ // if all else fails:
+ X = Fl::x();
+ Y = Fl::y();
+ W = Fl::w();
+ H = Fl::h();
#elif defined(__APPLE__)
if (num_screens > 0) {
int i;
@@ -236,6 +241,11 @@
}
}
}
+ // if all else fails:
+ X = Fl::x();
+ Y = Fl::y();
+ W = Fl::w();
+ H = Fl::h();
#elif HAVE_XINERAMA
if (num_screens > 0 && screens) { // screens == NULL if
!XineramaIsActive(fl_display)
int i;
@@ -253,15 +263,20 @@
}
}
}
+ // if all else fails:
+ X = Fl::x();
+ Y = Fl::y();
+ W = Fl::w();
+ H = Fl::h();
#else
(void)mx;
(void)my;
+ X = 0;
+ Y = 0;
+ W = DisplayWidth(fl_display, fl_screen);
+ H = DisplayHeight(fl_display, fl_screen);
#endif // WIN32
- X = Fl::x();
- Y = Fl::y();
- W = Fl::w();
- H = Fl::h();
}
/**
@@ -279,7 +294,11 @@
Y = screens[n].top;
W = screens[n].right - screens[n].left;
H = screens[n].bottom - screens[n].top;
- return;
+ } else {
+ X = Fl::x();
+ Y = Fl::y();
+ W = Fl::w();
+ H = Fl::h();
}
#elif defined(__APPLE__)
if (num_screens > 0 && n >= 0 && n < num_screens) {
@@ -287,24 +306,30 @@
Y = screens[n].y;
W = screens[n].width;
H = screens[n].height;
- return;
+ } else {
+ X = Fl::x();
+ Y = Fl::y();
+ W = Fl::w();
+ H = Fl::h();
}
#elif HAVE_XINERAMA
- if (num_screens > 0 && n >= 0 && n < num_screens) {
+ if (num_screens > 0 && n >= 0 && n < num_screens && screens) {
X = screens[n].x_org;
Y = screens[n].y_org;
W = screens[n].width;
H = screens[n].height;
- return;
+ } else {
+ X = Fl::x();
+ Y = Fl::y();
+ W = Fl::w();
+ H = Fl::h();
}
#else
- (void)n;
+ X = 0;
+ Y = 0;
+ W = DisplayWidth(fl_display, fl_screen);
+ H = DisplayHeight(fl_display, fl_screen);
#endif // WIN32
-
- X = Fl::x();
- Y = Fl::y();
- W = Fl::w();
- H = Fl::h();
}
static inline float fl_intersection(int x1, int y1, int w1, int h1,
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit