+ MouseContext::MC context;
+ EventHandler *h = openbox->findHandler(e.window);
+ Frame *f = dynamic_cast<Frame*>(h);
+ if (f)
+ context= f->mouseContext(e.window);
+ else if (dynamic_cast<Client*>(h))
+ context = MouseContext::Window;
+ else if (dynamic_cast<Screen*>(h))
+ context = MouseContext::Root;
+ else
+ return; // not a valid mouse context
+
+ // run the RELEASE python hook
+ // kill off the Button1Mask etc, only want the modifiers
+ unsigned int state = e.state & (ControlMask | ShiftMask | Mod1Mask |
+ Mod2Mask | Mod3Mask | Mod4Mask | Mod5Mask);
+ int screen;
+ Client *c = openbox->findClient(e.window);
+ if (c)
+ screen = c->screen();
+ else
+ screen = otk::display->findScreen(e.root)->screen();
+ MouseData data(screen, c, e.time, state, e.button, context,
+ MouseAction::Release);
+ openbox->bindings()->fireButton(&data);