summaryrefslogtreecommitdiff
path: root/src/Fl_Window_hotspot.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2011-10-31 19:44:55 +0000
committerManolo Gouy <Manolo>2011-10-31 19:44:55 +0000
commite37006f259776aa797c5b2ea82dad1925516bb04 (patch)
tree286f1e9ffb7fe63d10fe55e2be0eaa1e16b29850 /src/Fl_Window_hotspot.cxx
parent0cf73d4603dca847e8b08399ee6a9385ccf72781 (diff)
Fix STR #2759: Fl_Window::hotspot() now positions a new window correctly on a secondary display.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9163 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Window_hotspot.cxx')
-rw-r--r--src/Fl_Window_hotspot.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Fl_Window_hotspot.cxx b/src/Fl_Window_hotspot.cxx
index bbb5d6a15..626ad8885 100644
--- a/src/Fl_Window_hotspot.cxx
+++ b/src/Fl_Window_hotspot.cxx
@@ -32,7 +32,7 @@ void Fl_Window::hotspot(int X, int Y, int offscreen) {
// stays on the screen, if possible.
if (!offscreen) {
int scr_x, scr_y, scr_w, scr_h;
- Fl::screen_xywh(scr_x, scr_y, scr_w, scr_h);
+ Fl::screen_work_area(scr_x, scr_y, scr_w, scr_h);
int top = 0;
int left = 0;
@@ -64,10 +64,10 @@ void Fl_Window::hotspot(int X, int Y, int offscreen) {
#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);
}