- MotionData *data = new_motion_data(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;
+ OBClient *c = Openbox::instance->findClient(e.window);
+ if (c)
+ screen = c->screen();
+ else
+ screen = otk::OBDisplay::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);