From 4e0b5fdef451c605f563d137b024134a68c6d6de Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Wed, 4 Dec 2002 11:50:20 +0000 Subject: [PATCH] some cleanups make the OBActions instance not static --- src/actions.cc | 2 ++ src/actions.hh | 2 ++ src/openbox.cc | 5 ++--- src/openbox.hh | 6 +++--- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/actions.cc b/src/actions.cc index af33f51c..b83b521d 100644 --- a/src/actions.cc +++ b/src/actions.cc @@ -147,6 +147,8 @@ void OBActions::keyPressHandler(const XKeyEvent &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 printf("GUILE: MOTION: win %lx modifiers %u x %d y %d\n", (long)e.window, e.state, diff --git a/src/actions.hh b/src/actions.hh index 3d45966e..e57593f7 100644 --- a/src/actions.hh +++ b/src/actions.hh @@ -56,7 +56,9 @@ private: void removePress(const XButtonEvent &e); public: + //! Constructs an OBActions object OBActions(); + //! Destroys the OBActions object virtual ~OBActions(); virtual void buttonPressHandler(const XButtonEvent &e); diff --git a/src/openbox.cc b/src/openbox.cc index 24ea9b2e..18c4a5ca 100644 --- a/src/openbox.cc +++ b/src/openbox.cc @@ -51,7 +51,6 @@ extern "C" { namespace ob { Openbox *Openbox::instance = (Openbox *) 0; -OBActions *Openbox::actions = (OBActions *) 0; void Openbox::signalHandler(int signal) @@ -124,9 +123,9 @@ Openbox::Openbox(int argc, char **argv) _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 _cursors.session = XCreateFontCursor(otk::OBDisplay::display, XC_left_ptr); diff --git a/src/openbox.hh b/src/openbox.hh index b6c3d6d1..abdcfef3 100644 --- a/src/openbox.hh +++ b/src/openbox.hh @@ -51,9 +51,6 @@ public: */ static Openbox *instance; - //! The action interface through which all user-available actions occur - static OBActions *actions; - //! The posible running states of the window manager enum RunState { State_Starting, //!< The window manager is starting up (being created) @@ -115,6 +112,9 @@ private: */ otk::OBProperty *_property; + //! The action interface through which all user-available actions occur + OBActions *_actions; + //! The running state of the window manager RunState _state; -- 2.39.2