Fixed rootcommand

This commit is contained in:
fluxgen 2002-01-10 12:49:15 +00:00
parent affb5bda33
commit add890ad21
2 changed files with 35 additions and 27 deletions

View file

@ -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();

View file

@ -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;