diff options
author | fluxgen <fluxgen> | 2002-02-26 22:35:58 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2002-02-26 22:35:58 (GMT) |
commit | ddce8511658c7bb0a91962e5c22d2641eb760899 (patch) | |
tree | 87a0be23e87100981cf332452c9bfb71237d62cd | |
parent | 6f1a0490c4bdb4e04658205e5339eaa47d238279 (diff) | |
download | fluxbox_lack-ddce8511658c7bb0a91962e5c22d2641eb760899.zip fluxbox_lack-ddce8511658c7bb0a91962e5c22d2641eb760899.tar.bz2 |
added gnome layer stuff
-rw-r--r-- | src/Window.cc | 64 | ||||
-rw-r--r-- | src/Window.hh | 9 |
2 files changed, 67 insertions, 6 deletions
diff --git a/src/Window.cc b/src/Window.cc index aee5504..ee149a2 100644 --- a/src/Window.cc +++ b/src/Window.cc | |||
@@ -22,7 +22,7 @@ | |||
22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
23 | // DEALINGS IN THE SOFTWARE. | 23 | // DEALINGS IN THE SOFTWARE. |
24 | 24 | ||
25 | // $Id: Window.cc,v 1.29 2002/02/17 18:48:22 fluxgen Exp $ | 25 | // $Id: Window.cc,v 1.30 2002/02/26 22:35:58 fluxgen Exp $ |
26 | 26 | ||
27 | //use GNU extensions | 27 | //use GNU extensions |
28 | #ifndef _GNU_SOURCE | 28 | #ifndef _GNU_SOURCE |
@@ -73,6 +73,7 @@ timer(0), | |||
73 | display(0), | 73 | display(0), |
74 | lastButtonPressTime(0), | 74 | lastButtonPressTime(0), |
75 | windowmenu(0), | 75 | windowmenu(0), |
76 | m_layer(LAYER_NORMAL), | ||
76 | tab(0) | 77 | tab(0) |
77 | #ifdef GNOME | 78 | #ifdef GNOME |
78 | ,gnome_hints(0) | 79 | ,gnome_hints(0) |
@@ -921,7 +922,19 @@ int FluxboxWindow::getGnomeWindowState() { | |||
921 | 922 | ||
922 | //TODO | 923 | //TODO |
923 | int FluxboxWindow::getGnomeLayer() { | 924 | int FluxboxWindow::getGnomeLayer() { |
924 | return WIN_LAYER_NORMAL; | 925 | switch (m_layer) { |
926 | case LAYER_NORMAL: | ||
927 | return WIN_LAYER_NORMAL; | ||
928 | case LAYER_BOTTOM: | ||
929 | return WIN_LAYER_BELOW; | ||
930 | case LAYER_TOP: | ||
931 | return WIN_LAYER_ONTOP; | ||
932 | case LAYER_BELOW: | ||
933 | return WIN_LAYER_BELOW; | ||
934 | default: | ||
935 | break; | ||
936 | } | ||
937 | return WIN_LAYER_NORMAL; | ||
925 | } | 938 | } |
926 | 939 | ||
927 | bool FluxboxWindow::handleGnomePropertyNotify(Atom atom) { | 940 | bool FluxboxWindow::handleGnomePropertyNotify(Atom atom) { |
@@ -945,7 +958,7 @@ bool FluxboxWindow::handleGnomePropertyNotify(Atom atom) { | |||
945 | #ifdef DEBUG | 958 | #ifdef DEBUG |
946 | cerr<<__FILE__<<"("<<__LINE__<<"): gnome layer"<<endl; | 959 | cerr<<__FILE__<<"("<<__LINE__<<"): gnome layer"<<endl; |
947 | #endif | 960 | #endif |
948 | 961 | loadGnomeLayerAtom(); | |
949 | } else | 962 | } else |
950 | return false; | 963 | return false; |
951 | 964 | ||
@@ -994,12 +1007,36 @@ void FluxboxWindow::setGnomeState(int state) { | |||
994 | cerr<<"Arrange Ignore"<<endl; | 1007 | cerr<<"Arrange Ignore"<<endl; |
995 | */ | 1008 | */ |
996 | } | 1009 | } |
1010 | |||
1011 | void FluxboxWindow::setGnomeLayer(int layer) { | ||
1012 | switch (layer) { | ||
1013 | case WIN_LAYER_DESKTOP: | ||
1014 | m_layer = LAYER_BOTTOM; | ||
1015 | break; | ||
1016 | case WIN_LAYER_BELOW: | ||
1017 | m_layer = LAYER_BELOW; | ||
1018 | break; | ||
1019 | case WIN_LAYER_NORMAL: | ||
1020 | m_layer = LAYER_NORMAL; | ||
1021 | break; | ||
1022 | case WIN_LAYER_ONTOP: | ||
1023 | case WIN_LAYER_DOCK: | ||
1024 | case WIN_LAYER_ABOVE_DOCK: | ||
1025 | case WIN_LAYER_MENU: | ||
1026 | m_layer = LAYER_TOP; | ||
1027 | break; | ||
1028 | default: | ||
1029 | m_layer = LAYER_NORMAL; | ||
1030 | break; | ||
1031 | } | ||
1032 | } | ||
997 | //------------ loadGnomeAtoms ------------ | 1033 | //------------ loadGnomeAtoms ------------ |
998 | // Loads the values from the atoms | 1034 | // Loads the values from the atoms |
999 | //---------------------------------------- | 1035 | //---------------------------------------- |
1000 | void FluxboxWindow::loadGnomeAtoms() { | 1036 | void FluxboxWindow::loadGnomeAtoms() { |
1001 | loadGnomeStateAtom(); | 1037 | loadGnomeStateAtom(); |
1002 | loadGnomeHintsAtom(); | 1038 | loadGnomeHintsAtom(); |
1039 | loadGnomeLayerAtom(); | ||
1003 | } | 1040 | } |
1004 | //----------- loadGnomeStateAtom ------- | 1041 | //----------- loadGnomeStateAtom ------- |
1005 | // Gets gnome state from the atom | 1042 | // Gets gnome state from the atom |
@@ -1040,7 +1077,26 @@ void FluxboxWindow::loadGnomeHintsAtom() { | |||
1040 | XFree (data); | 1077 | XFree (data); |
1041 | } | 1078 | } |
1042 | } | 1079 | } |
1043 | 1080 | //---------- loadGnomeLayerAtom ------------ | |
1081 | // Gets the gnome layer from the atom | ||
1082 | //------------------------------------------ | ||
1083 | void FluxboxWindow::loadGnomeLayerAtom() { | ||
1084 | Atom ret_type; | ||
1085 | int fmt; | ||
1086 | unsigned long nitems, bytes_after; | ||
1087 | long *data = 0; | ||
1088 | BaseDisplay *bd = screen->getBaseDisplay(); | ||
1089 | if (XGetWindowProperty (bd->getXDisplay(), getClientWindow(), | ||
1090 | bd->getGnomeLayerAtom(), 0, 1, False, XA_CARDINAL, | ||
1091 | &ret_type, &fmt, &nitems, &bytes_after, | ||
1092 | (unsigned char **) &data) == Success && data) { | ||
1093 | setGnomeLayer(static_cast<int>(*data)); | ||
1094 | #ifdef DEBUG | ||
1095 | cerr<<__FILE__<<"("<<__LINE__<<"): gnome hints:0x"<<hex<<*data<<dec<<endl; | ||
1096 | #endif | ||
1097 | XFree (data); | ||
1098 | } | ||
1099 | } | ||
1044 | #endif //!GNOME | 1100 | #endif //!GNOME |
1045 | 1101 | ||
1046 | #ifdef NEWWMSPEC | 1102 | #ifdef NEWWMSPEC |
diff --git a/src/Window.hh b/src/Window.hh index 584d187..c65fa2f 100644 --- a/src/Window.hh +++ b/src/Window.hh | |||
@@ -22,7 +22,7 @@ | |||
22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
23 | // DEALINGS IN THE SOFTWARE. | 23 | // DEALINGS IN THE SOFTWARE. |
24 | 24 | ||
25 | // $Id: Window.hh,v 1.10 2002/02/17 18:47:45 fluxgen Exp $ | 25 | // $Id: Window.hh,v 1.11 2002/02/26 22:35:58 fluxgen Exp $ |
26 | 26 | ||
27 | #ifndef WINDOW_HH | 27 | #ifndef WINDOW_HH |
28 | #define WINDOW_HH | 28 | #define WINDOW_HH |
@@ -156,7 +156,7 @@ public: | |||
156 | inline const int &getYClient(void) const { return client.y; } | 156 | inline const int &getYClient(void) const { return client.y; } |
157 | inline const int &getWorkspaceNumber(void) const { return workspace_number; } | 157 | inline const int &getWorkspaceNumber(void) const { return workspace_number; } |
158 | inline const int &getWindowNumber(void) const { return window_number; } | 158 | inline const int &getWindowNumber(void) const { return window_number; } |
159 | 159 | inline const WinLayer getLayer(void) const { return m_layer; } | |
160 | inline const unsigned int &getWidth(void) const { return frame.width; } | 160 | inline const unsigned int &getWidth(void) const { return frame.width; } |
161 | inline const unsigned int &getHeight(void) const { return frame.height; } | 161 | inline const unsigned int &getHeight(void) const { return frame.height; } |
162 | inline const unsigned int &getClientHeight(void) const | 162 | inline const unsigned int &getClientHeight(void) const |
@@ -229,6 +229,7 @@ private: | |||
229 | 229 | ||
230 | int focus_mode, window_number, workspace_number; | 230 | int focus_mode, window_number, workspace_number; |
231 | unsigned long current_state; | 231 | unsigned long current_state; |
232 | WinLayer m_layer; | ||
232 | 233 | ||
233 | struct _client { | 234 | struct _client { |
234 | FluxboxWindow *transient_for, // which window are we a transient for? | 235 | FluxboxWindow *transient_for, // which window are we a transient for? |
@@ -309,12 +310,16 @@ private: | |||
309 | void updateGnomeLayerAtom(); | 310 | void updateGnomeLayerAtom(); |
310 | void updateGnomeWorkspaceAtom(); | 311 | void updateGnomeWorkspaceAtom(); |
311 | 312 | ||
313 | void setGnomeLayer(int layer); | ||
314 | |||
312 | int getGnomeWindowState(); | 315 | int getGnomeWindowState(); |
313 | bool handleGnomePropertyNotify(Atom atom); | 316 | bool handleGnomePropertyNotify(Atom atom); |
314 | int getGnomeLayer(); | 317 | int getGnomeLayer(); |
315 | void loadGnomeAtoms(); | 318 | void loadGnomeAtoms(); |
316 | void loadGnomeStateAtom(); | 319 | void loadGnomeStateAtom(); |
317 | void loadGnomeHintsAtom(); | 320 | void loadGnomeHintsAtom(); |
321 | void loadGnomeLayerAtom(); | ||
322 | |||
318 | int gnome_hints; | 323 | int gnome_hints; |
319 | #endif //GNOME | 324 | #endif //GNOME |
320 | 325 | ||