X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fscreen.cc;h=80b9083d6992d5e2db1c2551272a2e68cdd21886;hb=745e840547b5443ecfb9b6f0a4f14b0d035d59c2;hp=947471c241b8341ca50976b646b450e0b268e27a;hpb=fe55bb846db1933d8d6f023236298940cab441f8;p=chaz%2Fopenbox diff --git a/src/screen.cc b/src/screen.cc index 947471c2..80b9083d 100644 --- a/src/screen.cc +++ b/src/screen.cc @@ -22,6 +22,7 @@ extern "C" { #include "client.hh" #include "openbox.hh" #include "frame.hh" +#include "bindings.hh" #include "otk/display.hh" static bool running; @@ -36,7 +37,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) { @@ -73,8 +74,18 @@ OBScreen::OBScreen(int screen, const otk::Configuration &config) // initialize the screen's style _style.setImageControl(_image_control); - _style.load(config); - + std::string stylepath; + Openbox::instance->getConfigString("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(), @@ -89,6 +100,14 @@ OBScreen::OBScreen(int screen, const otk::Configuration &config) otk::OBProperty::Atom_Cardinal, viewport, 2); + // create the window which gets focus when no clients get it + XSetWindowAttributes attr; + attr.override_redirect = true; + _focuswindow = XCreateWindow(otk::OBDisplay::display, _info->rootWindow(), + -100, -100, 1, 1, 0, 0, InputOnly, + _info->visual(), CWOverrideRedirect, &attr); + XMapWindow(otk::OBDisplay::display, _focuswindow); + // these may be further updated if any pre-existing windows are found in // the manageExising() function setClientList(); // initialize the client lists, which will be empty @@ -314,14 +333,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;