just return if a valid widget isnt found, racey to assert

This commit is contained in:
Dana Jansens 2003-01-14 22:58:35 +00:00
parent 219e18e744
commit b267261403

View file

@ -74,7 +74,7 @@ void Actions::buttonPressHandler(const XButtonEvent &e)
// run the PRESS python hook // run the PRESS python hook
WidgetBase *w = dynamic_cast<WidgetBase*> WidgetBase *w = dynamic_cast<WidgetBase*>
(openbox->findHandler(e.window)); (openbox->findHandler(e.window));
assert(w); // everything should be a widget if (!w) return;
// kill off the Button1Mask etc, only want the modifiers // kill off the Button1Mask etc, only want the modifiers
unsigned int state = e.state & (ControlMask | ShiftMask | Mod1Mask | unsigned int state = e.state & (ControlMask | ShiftMask | Mod1Mask |
@ -113,7 +113,7 @@ void Actions::buttonReleaseHandler(const XButtonEvent &e)
WidgetBase *w = dynamic_cast<WidgetBase*> WidgetBase *w = dynamic_cast<WidgetBase*>
(openbox->findHandler(e.window)); (openbox->findHandler(e.window));
assert(w); // everything should be a widget if (!w) return;
// not for the button we're watching? // not for the button we're watching?
if (_button != e.button) return; if (_button != e.button) return;
@ -236,7 +236,7 @@ void Actions::motionHandler(const XMotionEvent &e)
WidgetBase *w = dynamic_cast<WidgetBase*> WidgetBase *w = dynamic_cast<WidgetBase*>
(openbox->findHandler(e.window)); (openbox->findHandler(e.window));
assert(w); // everything should be a widget if (!w) return;
// run the MOTION python hook // run the MOTION python hook
// kill off the Button1Mask etc, only want the modifiers // kill off the Button1Mask etc, only want the modifiers