summaryrefslogtreecommitdiff
path: root/src/Fl_Window_fullscreen.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2011-03-12 21:36:21 +0000
committerManolo Gouy <Manolo>2011-03-12 21:36:21 +0000
commit7aa48e19b9971c6ce902002c1421223a84a1a447 (patch)
tree67b51ebf94e910eee1f00d07c4afa832bde7056f /src/Fl_Window_fullscreen.cxx
parentc4099faffeb7bb2b5a1d4d3ace81021224f711c5 (diff)
Fix STR #2575: use the screen that intersects most of the window when made fullscreen.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8515 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Window_fullscreen.cxx')
-rw-r--r--src/Fl_Window_fullscreen.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Fl_Window_fullscreen.cxx b/src/Fl_Window_fullscreen.cxx
index 90a2fc924..629dd7e33 100644
--- a/src/Fl_Window_fullscreen.cxx
+++ b/src/Fl_Window_fullscreen.cxx
@@ -68,13 +68,16 @@ void Fl_Window::fullscreen() {
#endif
#if defined(__APPLE__) || defined(WIN32) || defined(USE_X11)
int sx, sy, sw, sh;
- Fl::screen_xywh(sx, sy, sw, sh, x()+w()/2, y()+h()/2);
+ Fl::screen_xywh(sx, sy, sw, sh, x(), y(), w(), h());
// if we are on the main screen, we will leave the system menu bar unobstructed
if (Fl::x()>=sx && Fl::y()>=sy && Fl::x()+Fl::w()<=sx+sw && Fl::y()+Fl::h()<=sy+sh) {
sx = Fl::x(); sy = Fl::y();
sw = Fl::w(); sh = Fl::h();
}
if (x()==sx) x(sx+1); // make sure that we actually execute the resize
+#if defined(USE_X11)
+ resize(0, 0, w(), h()); // work around some quirks in X11
+#endif
resize(sx, sy, sw, sh);
#else
if (!x()) x(1); // make sure that we actually execute the resize