- 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);
-}
-
-void OBActions::mapRequestHandler(const XMapRequestEvent &e)
-{
- OtkEventHandler::mapRequestHandler(e);
-
- if (_callback[EventNewWindow]) {
- EventData *data = new_event_data(e.window, EventNewWindow, 0);
- python_callback(_callback[EventNewWindow], (PyObject*)data);
- Py_DECREF((PyObject*)data);
- }
+ 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, button, w->mcontext(), MouseMotion,
+ x_root, y_root, _posqueue[0]->pos, _posqueue[0]->clientarea);
+ openbox->bindings()->fireButton(&data);