X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fscreen.cc;h=da603ed8cb3d690152853fa13c5cc46539651f78;hb=4721c53868187d10e3732cea63efa9fbd352178d;hp=61869a17a427c212e751947401d5b151b4de7cf9;hpb=1161a90a70b21d3064a9dee62c72dd4be3025ada;p=chaz%2Fopenbox diff --git a/src/screen.cc b/src/screen.cc index 61869a17..da603ed8 100644 --- a/src/screen.cc +++ b/src/screen.cc @@ -23,6 +23,7 @@ extern "C" { #include "openbox.hh" #include "frame.hh" #include "bindings.hh" +#include "python.hh" #include "otk/display.hh" static bool running; @@ -37,7 +38,7 @@ static int anotherWMRunning(Display *display, XErrorEvent *) { namespace ob { -OBScreen::OBScreen(int screen, const otk::Configuration &config) +OBScreen::OBScreen(int screen) : _number(screen), _root(screen) { @@ -74,8 +75,18 @@ OBScreen::OBScreen(int screen, const otk::Configuration &config) // initialize the screen's style _style.setImageControl(_image_control); - _style.load(config); - + std::string stylepath; + python_get_string("theme", &stylepath); + otk::Configuration sconfig(false); + sconfig.setFile(otk::expandTilde(stylepath)); + if (!sconfig.load()) { + sconfig.setFile(otk::expandTilde(DEFAULTSTYLE)); + if (!sconfig.load()) { + printf(_("Unable to load default style: %s. Aborting.\n"), DEFAULTSTYLE); + ::exit(1); + } + } + _style.load(sconfig); // Set the netwm atoms for geomtery and viewport unsigned long geometry[] = { _info->width(), @@ -323,14 +334,6 @@ void OBScreen::setWorkArea() { } -void OBScreen::loadStyle(const otk::Configuration &config) -{ - _style.load(config); - - // XXX: make stuff redraw! -} - - void OBScreen::manageWindow(Window window) { OBClient *client = 0;