some cleanups

make the OBActions instance not static
This commit is contained in:
Dana Jansens 2002-12-04 11:50:20 +00:00
parent 7dc834cc93
commit 4e0b5fdef4
4 changed files with 9 additions and 6 deletions

View file

@ -147,6 +147,8 @@ void OBActions::keyPressHandler(const XKeyEvent &e)
void OBActions::motionHandler(const XMotionEvent &e) void OBActions::motionHandler(const XMotionEvent &e)
{ {
if (!e.same_screen) return; // this just gets stupid
// XXX: i can envision all sorts of crazy shit with this.. gestures, etc // XXX: i can envision all sorts of crazy shit with this.. gestures, etc
printf("GUILE: MOTION: win %lx modifiers %u x %d y %d\n", printf("GUILE: MOTION: win %lx modifiers %u x %d y %d\n",
(long)e.window, e.state, (long)e.window, e.state,

View file

@ -56,7 +56,9 @@ private:
void removePress(const XButtonEvent &e); void removePress(const XButtonEvent &e);
public: public:
//! Constructs an OBActions object
OBActions(); OBActions();
//! Destroys the OBActions object
virtual ~OBActions(); virtual ~OBActions();
virtual void buttonPressHandler(const XButtonEvent &e); virtual void buttonPressHandler(const XButtonEvent &e);

View file

@ -51,7 +51,6 @@ extern "C" {
namespace ob { namespace ob {
Openbox *Openbox::instance = (Openbox *) 0; Openbox *Openbox::instance = (Openbox *) 0;
OBActions *Openbox::actions = (OBActions *) 0;
void Openbox::signalHandler(int signal) void Openbox::signalHandler(int signal)
@ -124,9 +123,9 @@ Openbox::Openbox(int argc, char **argv)
_property = new otk::OBProperty(); _property = new otk::OBProperty();
Openbox::actions = new OBActions(); _actions = new OBActions();
setMasterHandler(Openbox::actions); // set as the master event handler setMasterHandler(_actions); // set as the master event handler
// create the mouse cursors we'll use // create the mouse cursors we'll use
_cursors.session = XCreateFontCursor(otk::OBDisplay::display, XC_left_ptr); _cursors.session = XCreateFontCursor(otk::OBDisplay::display, XC_left_ptr);

View file

@ -51,9 +51,6 @@ public:
*/ */
static Openbox *instance; static Openbox *instance;
//! The action interface through which all user-available actions occur
static OBActions *actions;
//! The posible running states of the window manager //! The posible running states of the window manager
enum RunState { enum RunState {
State_Starting, //!< The window manager is starting up (being created) State_Starting, //!< The window manager is starting up (being created)
@ -115,6 +112,9 @@ private:
*/ */
otk::OBProperty *_property; otk::OBProperty *_property;
//! The action interface through which all user-available actions occur
OBActions *_actions;
//! The running state of the window manager //! The running state of the window manager
RunState _state; RunState _state;