summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FL/Fl_Window_Driver.H1
-rw-r--r--src/Fl_Window_Driver.cxx8
-rw-r--r--src/Fl_Window_fullscreen.cxx30
-rw-r--r--src/drivers/X11/Fl_X11_Window_Driver.H1
-rw-r--r--src/drivers/X11/Fl_X11_Window_Driver.cxx14
-rw-r--r--test/fullscreen.cxx5
6 files changed, 26 insertions, 33 deletions
diff --git a/FL/Fl_Window_Driver.H b/FL/Fl_Window_Driver.H
index 2deb7c5a3..89acb4938 100644
--- a/FL/Fl_Window_Driver.H
+++ b/FL/Fl_Window_Driver.H
@@ -93,6 +93,7 @@ public:
virtual void unmap() {}
virtual void fullscreen_on() {}
virtual void fullscreen_off(int X, int Y, int W, int H) {}
+ virtual void use_border();
// --- window shape stuff
void shape_pixmap_(Fl_Image* pixmap); // TODO: check
diff --git a/src/Fl_Window_Driver.cxx b/src/Fl_Window_Driver.cxx
index 6122d69d4..ef6c49c3b 100644
--- a/src/Fl_Window_Driver.cxx
+++ b/src/Fl_Window_Driver.cxx
@@ -196,6 +196,14 @@ int Fl_Window_Driver::hide_common() {
return 0;
}
+
+void Fl_Window_Driver::use_border() {
+ if (pWindow->shown()) {
+ pWindow->hide(); // hide and then show to reflect the new state of the window border
+ pWindow->show();
+ }
+}
+
//
// End of "$Id$".
//
diff --git a/src/Fl_Window_fullscreen.cxx b/src/Fl_Window_fullscreen.cxx
index e005302cc..71695c806 100644
--- a/src/Fl_Window_fullscreen.cxx
+++ b/src/Fl_Window_fullscreen.cxx
@@ -16,23 +16,9 @@
// http://www.fltk.org/str.php
//
-// Turning the border on/off by changing the motif_wm_hints property
-// works on Irix 4DWM. Does not appear to work for any other window
-// manager. Fullscreen still works on some window managers (fvwm is one)
-// because they allow the border to be placed off-screen.
-
-// Unfortunately most X window managers ignore changes to the border
-// and refuse to position the border off-screen, so attempting to make
-// the window full screen will lose the size of the border off the
-// bottom and right.
-
-#include <FL/Fl.H>
-#include <FL/x.H>
+#include <FL/Fl_Window.H>
#include <FL/Fl_Window_Driver.H>
-#include <config.h>
-
-
void Fl_Window::border(int b) {
if (b) {
if (border()) return;
@@ -41,18 +27,7 @@ void Fl_Window::border(int b) {
if (!border()) return;
set_flag(NOBORDER);
}
-#if defined(USE_X11)
- if (shown()) Fl_X::i(this)->sendxjunk();
-#elif defined(WIN32)
- // not yet implemented, but it's possible
- // for full fullscreen we have to make the window topmost as well
-#elif defined(__APPLE_QUARTZ__) // PORTME: Fl_Window_Driver - platform window driver
- // warning: not implemented in Quartz/Carbon
-#elif defined(FL_PORTING)
-# pragma message "handle window border setting"
-#else
-# error unsupported platform
-#endif
+ pWindowDriver->use_border();
}
/* Note: The previous implementation toggled border(). With this new
@@ -109,7 +84,6 @@ void Fl_Window::fullscreen_screens(int top, int bottom, int left, int right) {
pWindowDriver->fullscreen_on();
}
-
//
// End of "$Id$".
//
diff --git a/src/drivers/X11/Fl_X11_Window_Driver.H b/src/drivers/X11/Fl_X11_Window_Driver.H
index 89b16a4d9..95508a7cd 100644
--- a/src/drivers/X11/Fl_X11_Window_Driver.H
+++ b/src/drivers/X11/Fl_X11_Window_Driver.H
@@ -96,6 +96,7 @@ public:
virtual void unmap();
virtual void fullscreen_on();
virtual void fullscreen_off(int X, int Y, int W, int H);
+ virtual void use_border();
virtual void shape(const Fl_Image* img);
virtual void icons(const Fl_RGB_Image *icons[], int count);
diff --git a/src/drivers/X11/Fl_X11_Window_Driver.cxx b/src/drivers/X11/Fl_X11_Window_Driver.cxx
index 6de56f229..7beb6d9af 100644
--- a/src/drivers/X11/Fl_X11_Window_Driver.cxx
+++ b/src/drivers/X11/Fl_X11_Window_Driver.cxx
@@ -485,6 +485,20 @@ void Fl_X11_Window_Driver::unmap() {
XUnmapWindow(fl_display, fl_xid(pWindow));
}
+
+// Turning the border on/off by changing the motif_wm_hints property
+// works on Irix 4DWM. Does not appear to work for any other window
+// manager. Fullscreen still works on some window managers (fvwm is one)
+// because they allow the border to be placed off-screen.
+
+// Unfortunately most X window managers ignore changes to the border
+// and refuse to position the border off-screen, so attempting to make
+// the window full screen will lose the size of the border off the
+// bottom and right.
+void Fl_X11_Window_Driver::use_border() {
+ if (pWindow->shown()) Fl_X::i(pWindow)->sendxjunk();
+}
+
//
// End of "$Id$".
//
diff --git a/test/fullscreen.cxx b/test/fullscreen.cxx
index 0b2ce0e80..121b0ace4 100644
--- a/test/fullscreen.cxx
+++ b/test/fullscreen.cxx
@@ -163,11 +163,6 @@ void border_cb(Fl_Widget *o, void *p) {
Fl_Window *w = (Fl_Window *)p;
int d = ((Fl_Button *)o)->value();
w->border(d);
-#if defined(WIN32) || defined(__APPLE__)
- int wx = w->x(), wy = w->y();
- w->hide(); w->show();
- w->position(wx, wy);
-#endif
}
Fl_Button *border_button;