summaryrefslogtreecommitdiff
path: root/FL
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2012-03-23 16:47:53 +0000
committerManolo Gouy <Manolo>2012-03-23 16:47:53 +0000
commit08ce2e07d379d6b9925208b5da9323f948b634db (patch)
treecff1ab07cf0952cec8c1cf874ba9bcc7b241a041 /FL
parent8cd98f5236618f8ab9d576e709308b43246bc7ac (diff)
Fix STR#2641: true fullscreen windows that cover all their screen including menu bar, task bar, dock.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9299 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL')
-rw-r--r--FL/Enumerations.H7
-rw-r--r--FL/Fl_Widget.H6
-rw-r--r--FL/Fl_Window.H22
-rw-r--r--FL/names.h1
-rw-r--r--FL/x.H1
5 files changed, 32 insertions, 5 deletions
diff --git a/FL/Enumerations.H b/FL/Enumerations.H
index f0d24aca4..32825ecd0 100644
--- a/FL/Enumerations.H
+++ b/FL/Enumerations.H
@@ -3,7 +3,7 @@
//
// Enumerations for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2011 by Bill Spitzak and others.
+// Copyright 1998-2012 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -293,7 +293,10 @@ enum Fl_Event { // events
/** The screen configuration (number, positions) was changed.
Use Fl::add_handler() to be notified of this event.
*/
- FL_SCREEN_CONFIGURATION_CHANGED = 24
+ FL_SCREEN_CONFIGURATION_CHANGED = 24,
+ /** The fullscreen state of the window has changed
+ */
+ FL_FULLSCREEN = 25
};
/** \name When Conditions */
diff --git a/FL/Fl_Widget.H b/FL/Fl_Widget.H
index 7e7ed615a..27e6801c2 100644
--- a/FL/Fl_Widget.H
+++ b/FL/Fl_Widget.H
@@ -3,7 +3,7 @@
//
// Widget header file for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2012 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -170,6 +170,7 @@ protected:
NO_OVERLAY = 1<<15, ///< window not using a hardware overlay plane (Fl_Menu_Window)
GROUP_RELATIVE = 1<<16, ///< position this widget relative to the parent group, not to the window
COPIED_TOOLTIP = 1<<17, ///< the widget tooltip is internally copied, its destruction is handled by the widget
+ FULLSCREEN = 1<<18, ///< a fullscreen window (Fl_Window)
// (space for more flags)
USERFLAG3 = 1<<29, ///< reserved for 3rd party extensions
USERFLAG2 = 1<<30, ///< reserved for 3rd party extensions
@@ -843,6 +844,9 @@ public:
static unsigned int label_shortcut(const char *t);
/* Internal use only. */
static int test_shortcut(const char*, const bool require_alt = false);
+ /* Internal use only. */
+ void _set_fullscreen() {flags_ |= FULLSCREEN;}
+ void _clear_fullscreen() {flags_ &= ~FULLSCREEN;}
/** Checks if w is a child of this widget.
\param[in] w potential child widget
diff --git a/FL/Fl_Window.H b/FL/Fl_Window.H
index b6717f2e1..624e4b733 100644
--- a/FL/Fl_Window.H
+++ b/FL/Fl_Window.H
@@ -3,7 +3,7 @@
//
// Window header file for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2012 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -49,6 +49,10 @@ class Fl_X;
class FL_EXPORT Fl_Window : public Fl_Group {
static char *default_xclass_;
+#if FLTK_ABI_VERSION < 10302
+ static // when these members are static, ABI compatibility with 1.3.0 is respected
+#endif
+ int no_fullscreen_x, no_fullscreen_y, no_fullscreen_w, no_fullscreen_h;
friend class Fl_X;
Fl_X *i; // points at the system-specific stuff
@@ -65,6 +69,8 @@ class FL_EXPORT Fl_Window : public Fl_Group {
Fl_Color cursor_fg, cursor_bg;
void size_range_();
void _Fl_Window(); // constructor innards
+ void fullscreen_x(); // platform-specific part of sending a window to full screen
+ void fullscreen_off_x(int X, int Y, int W, int H);// platform-specific part of leaving full screen
// unimplemented copy ctor and assignment operator
Fl_Window(const Fl_Window&);
@@ -375,15 +381,27 @@ public:
/**
Makes the window completely fill the screen, without any window
manager border visible. You must use fullscreen_off() to undo
- this. This may not work with all window managers.
+ this.
+
+ \note On some platforms, this can result in the keyboard being
+ grabbed. The window may also be recreated, meaning hide() and
+ show() will be called.
*/
void fullscreen();
/**
+ Turns off any side effects of fullscreen()
+ */
+ void fullscreen_off();
+ /**
Turns off any side effects of fullscreen() and does
resize(x,y,w,h).
*/
void fullscreen_off(int,int,int,int);
/**
+ Returns non zero if FULLSCREEN flag is set, 0 otherwise.
+ */
+ unsigned int fullscreen_active() const { return flags() & FULLSCREEN; }
+ /**
Iconifies the window. If you call this when shown() is false
it will show() it as an icon. If the window is already
iconified this does nothing.
diff --git a/FL/names.h b/FL/names.h
index 09000c47e..5f653791e 100644
--- a/FL/names.h
+++ b/FL/names.h
@@ -67,6 +67,7 @@ const char * const fl_eventnames[] =
"FL_DND_LEAVE",
"FL_DND_RELEASE",
"FL_SCREEN_CONFIGURATION_CHANGED",
+ "FL_FULLSCREEN"
};
/**
diff --git a/FL/x.H b/FL/x.H
index 189c8050a..110f92d38 100644
--- a/FL/x.H
+++ b/FL/x.H
@@ -160,6 +160,7 @@ public:
void flush() {w->flush();}
static void x(Fl_Window* wi, int X) {wi->x(X);}
static void y(Fl_Window* wi, int Y) {wi->y(Y);}
+ static int ewmh_supported();
};
extern FL_EXPORT char fl_override_redirect; // hack into Fl_X::make_xid()