2 // "$Id: Fl_Window_fullscreen.cxx 8515 2011-03-12 21:36:21Z manolo $"
4 // Fullscreen window support for the Fast Light Tool Kit (FLTK).
6 // Copyright 1998-2010 by Bill Spitzak and others.
8 // This library is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU Library General Public
10 // License as published by the Free Software Foundation; either
11 // version 2 of the License, or (at your option) any later version.
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Library General Public License for more details.
18 // You should have received a copy of the GNU Library General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
23 // Please report all bugs and problems on the following page:
25 // http://www.fltk.org/str.php
28 // Turning the border on/off by changing the motif_wm_hints property
29 // works on Irix 4DWM. Does not appear to work for any other window
30 // manager. Fullscreen still works on some window managers (fvwm is one)
31 // because they allow the border to be placed off-screen.
33 // Unfortunately most X window managers ignore changes to the border
34 // and refuse to position the border off-screen, so attempting to make
35 // the window full screen will lose the size of the border off the
43 void Fl_Window::border(int b
) {
48 if (!border()) return;
52 if (shown()) Fl_X::i(this)->sendxjunk();
54 // not yet implemented, but it's possible
55 // for full fullscreen we have to make the window topmost as well
56 #elif defined(__APPLE_QUARTZ__)
57 // warning: not implemented in Quartz/Carbon
59 # error unsupported platform
63 void Fl_Window::fullscreen() {
65 //this would clobber the fake wm, since it relies on the border flags to
66 //determine its thickness
69 #if defined(__APPLE__) || defined(WIN32) || defined(USE_X11)
71 Fl::screen_xywh(sx
, sy
, sw
, sh
, x(), y(), w(), h());
72 // if we are on the main screen, we will leave the system menu bar unobstructed
73 if (Fl::x()>=sx
&& Fl::y()>=sy
&& Fl::x()+Fl::w()<=sx
+sw
&& Fl::y()+Fl::h()<=sy
+sh
) {
74 sx
= Fl::x(); sy
= Fl::y();
75 sw
= Fl::w(); sh
= Fl::h();
77 if (x()==sx
) x(sx
+1); // make sure that we actually execute the resize
79 resize(0, 0, w(), h()); // work around some quirks in X11
81 resize(sx
, sy
, sw
, sh
);
83 if (!x()) x(1); // make sure that we actually execute the resize
84 resize(0,0,Fl::w(),Fl::h());
88 void Fl_Window::fullscreen_off(int X
,int Y
,int W
,int H
) {
89 // this order produces less blinking on IRIX:
97 // End of "$Id: Fl_Window_fullscreen.cxx 8515 2011-03-12 21:36:21Z manolo $".