X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Factions.cc;h=26805df3b7d438b2a010409b91b9673f973680c9;hb=579ed5aa8d1b33a69476c2182a98ebc30557f096;hp=b6f1dad8a1026c4ff00b75b72ef54acd5bdfcf92;hpb=66a26917a0631463df7f72c34cbeb39df466918a;p=chaz%2Fopenbox diff --git a/src/actions.cc b/src/actions.cc index b6f1dad8..26805df3 100644 --- a/src/actions.cc +++ b/src/actions.cc @@ -56,11 +56,6 @@ void OBActions::buttonReleaseHandler(const XButtonEvent &e) OBWidget *w = dynamic_cast (Openbox::instance->findHandler(e.window)); - // run the RELEASE python hook - doCallback(Action_ButtonRelease, e.window, - (OBWidget::WidgetType)(w ? w->type():-1), - e.state, e.button, e.x_root, e.y_root, e.time); - // not for the button we're watching? if (_button != e.button) return; @@ -163,7 +158,7 @@ void OBActions::motionHandler(const XMotionEvent &e) // run the simple MOTION python hook for now... doCallback(Action_MouseMotion, e.window, (OBWidget::WidgetType)(w ? w->type():-1), - e.state, (unsigned)-1, e.x_root, e.y_root, e.time); + e.state, (unsigned)-1, x_root, y_root, e.time); } void OBActions::mapRequestHandler(const XMapRequestEvent &e) @@ -216,12 +211,11 @@ bool OBActions::registerCallback(ActionType action, PyObject *func, CallbackMap::iterator it; for (it = it_pair.first; it != it_pair.second; ++it) if (it->second == func) - break; - if (it == it_pair.second) // not already in there - if (atfront) - _callbacks.insert(_callbacks.begin(), CallbackMapPair(action, func)); - else - _callbacks.insert(CallbackMapPair(action, func)); + return true; // already in there + if (atfront) + _callbacks.insert(_callbacks.begin(), CallbackMapPair(action, func)); + else + _callbacks.insert(CallbackMapPair(action, func)); Py_INCREF(func); return true; }