aboutsummaryrefslogtreecommitdiff
path: root/src/Window.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Window.cc')
-rw-r--r--src/Window.cc64
1 files changed, 60 insertions, 4 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),
73display(0), 73display(0),
74lastButtonPressTime(0), 74lastButtonPressTime(0),
75windowmenu(0), 75windowmenu(0),
76m_layer(LAYER_NORMAL),
76tab(0) 77tab(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
923int FluxboxWindow::getGnomeLayer() { 924int 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
927bool FluxboxWindow::handleGnomePropertyNotify(Atom atom) { 940bool 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
1011void 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//----------------------------------------
1000void FluxboxWindow::loadGnomeAtoms() { 1036void 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//------------------------------------------
1083void 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