From add890ad213be267e0efae7ae8c958e1f2614efb Mon Sep 17 00:00:00 2001
From: fluxgen <fluxgen>
Date: Thu, 10 Jan 2002 12:49:15 +0000
Subject: Fixed rootcommand

---
 src/Screen.cc | 21 +++++++++++++--------
 src/Screen.hh | 41 ++++++++++++++++++++++-------------------
 2 files changed, 35 insertions(+), 27 deletions(-)

diff --git a/src/Screen.cc b/src/Screen.cc
index 9f67c3b..74b0c22 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -125,7 +125,9 @@ static int dcmp(const void *one, const void *two) {
 	return (strcmp((*(char **) one), (*(char **) two)));
 }
 
-BScreen::BScreen(Fluxbox *b, int scrn) : ScreenInfo(b, scrn) {
+BScreen::BScreen(Fluxbox *b, int scrn) : ScreenInfo(b, scrn),
+rootcommand("")
+{
 	theme = 0;
 	fluxbox = b;
 
@@ -192,7 +194,7 @@ BScreen::BScreen(Fluxbox *b, int scrn) : ScreenInfo(b, scrn) {
 
 	image_control->setDither(resource.image_dither);
 	theme = new Theme(getBaseDisplay()->getXDisplay(), getRootWindow(), getColormap(), getScreenNumber(), 
-			image_control, fluxbox->getStyleFilename(), fluxbox->getRootCommand());
+			image_control, fluxbox->getStyleFilename(), getRootCommand().c_str());
 	
 #ifdef GNOME
 	/* create the GNOME window */
@@ -203,14 +205,16 @@ BScreen::BScreen(Fluxbox *b, int scrn) : ScreenInfo(b, scrn) {
   XChangeProperty(getBaseDisplay()->getXDisplay(),
 			getRootWindow(), getBaseDisplay()->getGnomeSupportingWMCheckAtom(), 
 			XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &gnome_win, 1);
+ 
   XChangeProperty(getBaseDisplay()->getXDisplay(), gnome_win, 
 		getBaseDisplay()->getGnomeSupportingWMCheckAtom(), 
 		XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &gnome_win, 1);
-	 
+	
+	Atom gnomeatomlist[1] = {getBaseDisplay()->getGnomeWorkspaceAtom()};
   XChangeProperty(getBaseDisplay()->getXDisplay(),
 		getRootWindow(), getBaseDisplay()->getGnomeProtAtom(),
 		XA_ATOM, 32, PropModeReplace,
-		(unsigned char *)getBaseDisplay()->getGnomeListAtoms(), 10);			
+		(unsigned char *)gnomeatomlist, 1);
 #endif 
 
 
@@ -433,10 +437,11 @@ BScreen::~BScreen(void) {
 }
 
 void BScreen::reconfigure(void) {
-	if (Fluxbox::instance()->getRootCommand())
-		theme->setRootCommand(Fluxbox::instance()->getRootCommand());
-	else
-		theme->setRootCommand("");
+	#ifdef DEBUG
+	cerr<<__FILE__<<"("<<__LINE__<<"): BScreen::reconfigure"<<endl;
+	#endif
+	Fluxbox::instance()->loadRootCommand(this);
+	theme->setRootCommand(getRootCommand());
 
 	theme->load(fluxbox->getStyleFilename());
 	theme->reconfigure();
diff --git a/src/Screen.hh b/src/Screen.hh
index 35a4a85..92f1849 100644
--- a/src/Screen.hh
+++ b/src/Screen.hh
@@ -22,29 +22,12 @@
 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 // DEALINGS IN THE SOFTWARE.
 
-// $Id: Screen.hh,v 1.7 2002/01/09 14:11:20 fluxgen Exp $
+// $Id: Screen.hh,v 1.8 2002/01/10 12:49:15 fluxgen Exp $
 
 #ifndef	 _SCREEN_HH_
 #define	 _SCREEN_HH_
 
 
-
-#include <X11/Xlib.h>
-#include <X11/Xresource.h>
-
-#ifdef		TIME_WITH_SYS_TIME
-#	include <sys/time.h>
-#	include <time.h>
-#else // !TIME_WITH_SYS_TIME
-#	ifdef		HAVE_SYS_TIME_H
-#		include <sys/time.h>
-#	else // !HAVE_SYS_TIME_H
-#		include <time.h>
-#	endif // HAVE_SYS_TIME_H
-#endif // TIME_WITH_SYS_TIME
-
-#include <stdio.h>
-
 #include "Theme.hh"
 
 // forward declaration
@@ -84,6 +67,24 @@ class BScreen;
 #	include "Slit.hh"
 #endif // SLIT
 
+
+#include <X11/Xlib.h>
+#include <X11/Xresource.h>
+
+#ifdef		TIME_WITH_SYS_TIME
+#	include <sys/time.h>
+#	include <time.h>
+#else // !TIME_WITH_SYS_TIME
+#	ifdef		HAVE_SYS_TIME_H
+#		include <sys/time.h>
+#	else // !HAVE_SYS_TIME_H
+#		include <time.h>
+#	endif // HAVE_SYS_TIME_H
+#endif // TIME_WITH_SYS_TIME
+
+#include <stdio.h>
+#include <string>
+
 class BScreen : public ScreenInfo {
 public:
 	BScreen(Fluxbox *, int);
@@ -120,7 +121,7 @@ public:
 	inline const BColor *getBorderColor(void) { return &theme->getBorderColor(); }
 	inline BImageControl *getImageControl(void) { return image_control; }
 	inline Rootmenu *getRootmenu(void) { return rootmenu; }
-
+	inline std::string &getRootCommand(void) { return rootcommand; }
 #ifdef	 SLIT
 	inline const Bool &isSlitOnTop(void) const { return resource.slit_on_top; }
 	inline const Bool &doSlitAutoHide(void) const
@@ -183,6 +184,7 @@ public:
 	{ return resource.tab_alignment; }
 
 	inline void setRootColormapInstalled(Bool r) { root_colormap_installed = r; }
+	inline void saveRootCommand(std::string rootcmd) { rootcommand = rootcmd; }
 	inline void saveSloppyFocus(Bool s) { resource.sloppy_focus = s; }
 	inline void saveSemiSloppyFocus(Bool s) { resource.semi_sloppy_focus = s; }
 	inline void saveAutoRaise(Bool a) { resource.auto_raise = a; }
@@ -278,6 +280,7 @@ public:
 
 private:
 	Theme *theme;
+	std::string rootcommand;
 	
 	Bool root_colormap_installed, managed, geom_visible;
 	GC opGC;
-- 
cgit v0.11.2