summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/actions.cc2
-rw-r--r--src/openbox.cc31
-rw-r--r--src/openbox.hh5
-rw-r--r--src/screen.cc6
4 files changed, 16 insertions, 28 deletions
diff --git a/src/actions.cc b/src/actions.cc
index cefa5778..1213f21e 100644
--- a/src/actions.cc
+++ b/src/actions.cc
@@ -72,6 +72,8 @@ void Actions::buttonPressHandler(const XButtonEvent &e)
otk::EventHandler::buttonPressHandler(e);
insertPress(e);
+ printf("press queue %u pressed %u\n", _button, e.button);
+
MouseContext::MC context;
EventHandler *h = openbox->findHandler(e.window);
Frame *f = dynamic_cast<Frame*>(h);
diff --git a/src/openbox.cc b/src/openbox.cc
index 89e541aa..d068880b 100644
--- a/src/openbox.cc
+++ b/src/openbox.cc
@@ -38,6 +38,11 @@ extern "C" {
#include <cstdio>
#include <cstdlib>
+namespace otk {
+extern void initialize();
+extern void destroy();
+}
+
namespace ob {
Openbox *openbox = (Openbox *) 0;
@@ -73,8 +78,7 @@ void Openbox::signalHandler(int signal)
Openbox::Openbox(int argc, char **argv)
: otk::EventDispatcher(),
- otk::EventHandler(),
- _display()
+ otk::EventHandler()
{
struct sigaction action;
@@ -82,7 +86,6 @@ Openbox::Openbox(int argc, char **argv)
openbox = this;
- _displayreq = (char*) 0;
_argv = argv;
_shutdown = false;
_restart = false;
@@ -94,6 +97,8 @@ Openbox::Openbox(int argc, char **argv)
parseCommandLine(argc, argv);
+ otk::initialize();
+
XSynchronize(**otk::display, _sync);
// set up the signal handler
@@ -112,10 +117,6 @@ Openbox::Openbox(int argc, char **argv)
// anything that died while we were restarting won't give us a SIGCHLD
while (waitpid(-1, NULL, WNOHANG) > 0);
- otk::RenderColor::initialize();
- otk::RenderStyle::initialize();
- otk::Timer::initialize();
- otk::Property::initialize();
_actions = new Actions();
_bindings = new Bindings();
@@ -200,14 +201,7 @@ Openbox::~Openbox()
CurrentTime);
XSync(**otk::display, false);
- // this tends to block.. i honestly am not sure why. causing an x error in
- // the shutdown process unblocks it. blackbox simply did a ::exit(0), so
- // all im gunna do is the same.
- //delete _display;
-
- otk::Timer::destroy();
- otk::RenderStyle::destroy();
- otk::RenderColor::destroy();
+ otk::destroy();
}
@@ -218,12 +212,7 @@ void Openbox::parseCommandLine(int argc, char **argv)
for (int i = 1; i < argc; ++i) {
std::string arg(argv[i]);
- if (arg == "-display") {
- if (++i >= argc)
- err = true;
- else
- _displayreq = argv[i];
- } else if (arg == "-rc") {
+ if (arg == "-rc") {
if (++i >= argc)
err = true;
else
diff --git a/src/openbox.hh b/src/openbox.hh
index 8145531f..e718dd25 100644
--- a/src/openbox.hh
+++ b/src/openbox.hh
@@ -72,9 +72,6 @@ public:
typedef std::vector<Screen *> ScreenList;
private:
- //! The display on which Openbox is running
- otk::Display _display;
-
// stuff that can be passed on the command line
//! Path to the config file to use/in use
/*!
@@ -91,8 +88,6 @@ private:
Defaults to $(HOME)/.openbox/user.py
*/
std::string _scriptfilepath;
- //! The display requested by the user, or null to use the DISPLAY env var
- char *_displayreq;
//! The value of argv, i.e. how this application was executed
char **_argv;
//! Run the application in synchronous mode? (for debugging)
diff --git a/src/screen.cc b/src/screen.cc
index 3f507afb..6eaa5cc5 100644
--- a/src/screen.cc
+++ b/src/screen.cc
@@ -10,6 +10,7 @@
#include "python.hh"
#include "otk/display.hh"
#include "otk/property.hh"
+#include "otk/util.hh"
extern "C" {
#ifdef HAVE_UNISTD_H
@@ -68,8 +69,9 @@ Screen::Screen(int screen)
// initialize the screen's style
otk::RenderStyle::setStyle(_number, _config.theme);
- otk::display->renderControl(_number)->
- drawRoot(*otk::RenderStyle::style(_number)->rootColor());
+ // draw the root window
+ otk::bexec("obsetroot " + otk::RenderStyle::style(_number)->rootArgs(),
+ _info->displayString());
// set up notification of netwm support
changeSupportedAtoms();