#include "client.hh"
#include "openbox.hh"
#include "frame.hh"
+#include "bindings.hh"
#include "otk/display.hh"
static bool running;
namespace ob {
-OBScreen::OBScreen(int screen, const otk::Configuration &config)
+OBScreen::OBScreen(int screen)
: _number(screen),
_root(screen)
{
// 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(),
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
}
-void OBScreen::loadStyle(const otk::Configuration &config)
-{
- _style.load(config);
-
- // XXX: make stuff redraw!
-}
-
-
void OBScreen::manageWindow(Window window)
{
OBClient *client = 0;