A clean & short implementation of always-on-top for wbar 1.3.3.
(C) Curaga (Lauri Kasanen), under GPLv2

diff -Naur wbar-1.3.3/Main.cc wbar-1.3.3.laxy/Main.cc
--- wbar-1.3.3/Main.cc	2007-08-06 15:28:11.000000000 +0300
+++ wbar-1.3.3.laxy/Main.cc	2009-01-25 18:56:50.000000000 +0200
@@ -39,6 +39,7 @@
     optparser.addOption("help", 0);
     optparser.addOption("config", 1, "-");
     optparser.addOption("above-desk", 0);
+    optparser.addOption("always-ontop", 0);
     optparser.addOption("isize", 1, "32");
     optparser.addOption("idist", 1, "1");
     optparser.addOption("zoomf", 1, "1.8");
@@ -61,6 +62,7 @@
 	cout << "   -help             this help" << endl;
 	cout << "   -config conf-file (eg: $HOME/.wbar)" << endl;
 	cout << "   -above-desk       run over a desktop app (ie: xfdesktop)" << endl;
+	cout << "   -always-ontop     be on top instead of bottom" << endl;
 	cout << "   -isize  i         icon size (eg: 32)" << endl;
 	cout << "   -idist  d         icon dist (eg: 1)" << endl;
 	cout << "   -zoomf  z         zoom factor (eg: 1.8 or 2.5)" << endl;
@@ -88,10 +90,14 @@
 	barwin.skipTaskNPager();
 	barwin.noDecorations();
 	barwin.setSticky();
-	barwin.bottomLayer();
+	if( ! optparser.isset("always-ontop") ) barwin.bottomLayer();
     }else{
 	barwin.setOverrideRedirection();
-	barwin.lowerWindow();
+	if( ! optparser.isset("always-ontop") ) barwin.lowerWindow();
+    }
+
+    if( optparser.isset("always-ontop") ){
+        barwin.goOnTop();
     }
 
     /* tell X what events we're intrested in */
diff -Naur wbar-1.3.3/XWin.cc wbar-1.3.3.laxy/XWin.cc
--- wbar-1.3.3/XWin.cc	2007-01-26 21:15:59.000000000 +0200
+++ wbar-1.3.3.laxy/XWin.cc	2009-01-25 18:42:42.000000000 +0200
@@ -174,3 +174,17 @@
 	XChangeProperty(display, window, a, XA_ATOM, 32, PropModeAppend, (unsigned char *) &prop, 1);
     }
 }
+
+void XWin::goOnTop(){
+    Atom a = XInternAtom(display, "_WIN_LAYER", True);
+    if (a != None) {
+	long prop = 12; // 6 is above && _NET_WM_STATE_ABOVE in STATE
+	XChangeProperty(display, window, a, XA_CARDINAL, 32, PropModeAppend, (unsigned char *) &prop, 1);
+    }
+
+    a = XInternAtom(display, "_NET_WM_STATE", True);
+    if (a != None) {
+	Atom prop = XInternAtom(display, "_NET_WM_STATE_ABOVE", True);
+	XChangeProperty(display, window, a, XA_ATOM, 32, PropModeAppend, (unsigned char *) &prop, 1);
+    }
+}
diff -Naur wbar-1.3.3/XWin.h wbar-1.3.3.laxy/XWin.h
--- wbar-1.3.3/XWin.h	2007-01-26 21:15:59.000000000 +0200
+++ wbar-1.3.3.laxy/XWin.h	2009-01-25 18:43:17.000000000 +0200
@@ -52,6 +52,7 @@
 	void setSticky();
 	void skipTaskNPager();
 	void bottomLayer();
+	void goOnTop();
 };
 
 #endif /* _XWIN_H_ */
