all repos — fluxbox @ ddce8511658c7bb0a91962e5c22d2641eb760899

custom fork of the fluxbox windowmanager

added gnome layer stuff
fluxgen fluxgen
commit

ddce8511658c7bb0a91962e5c22d2641eb760899

parent

6f1a0490c4bdb4e04658205e5339eaa47d238279

2 files changed, 67 insertions(+), 6 deletions(-)

jump to
M src/Window.ccsrc/Window.cc

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Window.cc,v 1.29 2002/02/17 18:48:22 fluxgen Exp $ +// $Id: Window.cc,v 1.30 2002/02/26 22:35:58 fluxgen Exp $ //use GNU extensions #ifndef _GNU_SOURCE

@@ -73,6 +73,7 @@ timer(0),

display(0), lastButtonPressTime(0), windowmenu(0), +m_layer(LAYER_NORMAL), tab(0) #ifdef GNOME ,gnome_hints(0)

@@ -921,7 +922,19 @@ }

//TODO int FluxboxWindow::getGnomeLayer() { - return WIN_LAYER_NORMAL; + switch (m_layer) { + case LAYER_NORMAL: + return WIN_LAYER_NORMAL; + case LAYER_BOTTOM: + return WIN_LAYER_BELOW; + case LAYER_TOP: + return WIN_LAYER_ONTOP; + case LAYER_BELOW: + return WIN_LAYER_BELOW; + default: + break; + } + return WIN_LAYER_NORMAL; } bool FluxboxWindow::handleGnomePropertyNotify(Atom atom) {

@@ -945,7 +958,7 @@ } else if (atom == bd->getGnomeLayerAtom()){

#ifdef DEBUG cerr<<__FILE__<<"("<<__LINE__<<"): gnome layer"<<endl; #endif - + loadGnomeLayerAtom(); } else return false;

@@ -994,12 +1007,36 @@ if (state & WIN_STATE_ARRANGE_IGNORE)

cerr<<"Arrange Ignore"<<endl; */ } + +void FluxboxWindow::setGnomeLayer(int layer) { + switch (layer) { + case WIN_LAYER_DESKTOP: + m_layer = LAYER_BOTTOM; + break; + case WIN_LAYER_BELOW: + m_layer = LAYER_BELOW; + break; + case WIN_LAYER_NORMAL: + m_layer = LAYER_NORMAL; + break; + case WIN_LAYER_ONTOP: + case WIN_LAYER_DOCK: + case WIN_LAYER_ABOVE_DOCK: + case WIN_LAYER_MENU: + m_layer = LAYER_TOP; + break; + default: + m_layer = LAYER_NORMAL; + break; + } +} //------------ loadGnomeAtoms ------------ // Loads the values from the atoms //---------------------------------------- void FluxboxWindow::loadGnomeAtoms() { loadGnomeStateAtom(); loadGnomeHintsAtom(); + loadGnomeLayerAtom(); } //----------- loadGnomeStateAtom ------- // Gets gnome state from the atom

@@ -1040,7 +1077,26 @@ #endif

XFree (data); } } - +//---------- loadGnomeLayerAtom ------------ +// Gets the gnome layer from the atom +//------------------------------------------ +void FluxboxWindow::loadGnomeLayerAtom() { + Atom ret_type; + int fmt; + unsigned long nitems, bytes_after; + long *data = 0; + BaseDisplay *bd = screen->getBaseDisplay(); + if (XGetWindowProperty (bd->getXDisplay(), getClientWindow(), + bd->getGnomeLayerAtom(), 0, 1, False, XA_CARDINAL, + &ret_type, &fmt, &nitems, &bytes_after, + (unsigned char **) &data) == Success && data) { + setGnomeLayer(static_cast<int>(*data)); + #ifdef DEBUG + cerr<<__FILE__<<"("<<__LINE__<<"): gnome hints:0x"<<hex<<*data<<dec<<endl; + #endif + XFree (data); + } +} #endif //!GNOME #ifdef NEWWMSPEC
M src/Window.hhsrc/Window.hh

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Window.hh,v 1.10 2002/02/17 18:47:45 fluxgen Exp $ +// $Id: Window.hh,v 1.11 2002/02/26 22:35:58 fluxgen Exp $ #ifndef WINDOW_HH #define WINDOW_HH

@@ -156,7 +156,7 @@ inline const int &getXClient(void) const { return client.x; }

inline const int &getYClient(void) const { return client.y; } inline const int &getWorkspaceNumber(void) const { return workspace_number; } inline const int &getWindowNumber(void) const { return window_number; } - + inline const WinLayer getLayer(void) const { return m_layer; } inline const unsigned int &getWidth(void) const { return frame.width; } inline const unsigned int &getHeight(void) const { return frame.height; } inline const unsigned int &getClientHeight(void) const

@@ -229,6 +229,7 @@ Windowmenu *windowmenu;

int focus_mode, window_number, workspace_number; unsigned long current_state; + WinLayer m_layer; struct _client { FluxboxWindow *transient_for, // which window are we a transient for?

@@ -309,12 +310,16 @@ void updateGnomeHintsAtom();

void updateGnomeLayerAtom(); void updateGnomeWorkspaceAtom(); + void setGnomeLayer(int layer); + int getGnomeWindowState(); bool handleGnomePropertyNotify(Atom atom); int getGnomeLayer(); void loadGnomeAtoms(); void loadGnomeStateAtom(); void loadGnomeHintsAtom(); + void loadGnomeLayerAtom(); + int gnome_hints; #endif //GNOME