Author: manolo
Date: 2011-10-31 13:02:29 -0700 (Mon, 31 Oct 2011)
New Revision: 9164
Log:
Fix STR #2759: fltk3::Window::hotspot() now positions a new window correctly on
a secondary display.
Modified:
branches/branch-3.0/src/fltk3/Window_hotspot.cxx
Modified: branches/branch-3.0/src/fltk3/Window_hotspot.cxx
===================================================================
--- branches/branch-3.0/src/fltk3/Window_hotspot.cxx 2011-10-31 19:44:55 UTC
(rev 9163)
+++ branches/branch-3.0/src/fltk3/Window_hotspot.cxx 2011-10-31 20:02:29 UTC
(rev 9164)
@@ -41,7 +41,7 @@
// stays on the screen, if possible.
if (!offscreen) {
int scr_x, scr_y, scr_w, scr_h;
- fltk3::screen_xywh(scr_x, scr_y, scr_w, scr_h);
+ fltk3::screen_work_area(scr_x, scr_y, scr_w, scr_h);
int top = 0;
int left = 0;
@@ -73,10 +73,10 @@
#endif
}
// now insure contents are on-screen (more important than border):
- if (X+w()+right > scr_w-scr_x) X = scr_w-scr_x-right-w();
- if (X-left < scr_x) X = left;
- if (Y+h()+bottom > scr_h-scr_y) Y = scr_h-scr_y-bottom-h();
- if (Y-top < scr_y) Y = top;
+ if (X+w()+right > scr_w+scr_x) X = scr_w+scr_x-right-w();
+ if (X-left < scr_x) X = left + scr_x;
+ if (Y+h()+bottom > scr_h+scr_y) Y = scr_h+scr_y-bottom-h();
+ if (Y-top < scr_y) Y = top + scr_y;
// make sure that we will force this position
if (X==x()) x(X-1);
}
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit