- MotionData *data =
- new_motion_data(otk::OBDisplay::findScreen(e.root)->screen(),
- e.window, e.time, state, button, w->mcontext(),
- MouseMotion, x_root, y_root, _posqueue[0]->pos,
- _posqueue[0]->clientarea);
- Openbox::instance->bindings()->fireButton((ButtonData*)data);
- Py_DECREF((PyObject*)data);
+ int screen;
+ Client *c = Openbox::instance->findClient(e.window);
+ if (c)
+ screen = c->screen();
+ else
+ screen = otk::Display::findScreen(e.root)->screen();
+ MouseData data(screen, c, e.time, state, button, w->mcontext(), MouseMotion,
+ x_root, y_root, _posqueue[0]->pos, _posqueue[0]->clientarea);
+ Openbox::instance->bindings()->fireButton(&data);