DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2646
Version: 1.3.0


This is a follow up to STR #2640. I missed one case: When building FLTK
without HAVE_XINERAMA, or when running against an Xserver without
Xinerama, screen_xywh will still fall back on reporting the work area
rather than the real screen size. To prevent similar future problems, I've
removed the remaining references to x,y,w,h. 

We also need an additional check for the case when screens=NULL. 

The attached patch should fix both problems.


Link: http://www.fltk.org/str.php?L2646
Version: 1.3.0
Index: src/screen_xywh.cxx
===================================================================
--- src/screen_xywh.cxx (revision 8737)
+++ src/screen_xywh.cxx (arbetskopia)
@@ -256,12 +256,11 @@
 #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();
 }
 
 /**
@@ -290,7 +289,7 @@
     return;
   }
 #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;
@@ -298,13 +297,11 @@
     return;
   }
 #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-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs

Reply via email to