- printf("motion %d x:%d y:%d winx:%d winy:%d\n", button, x_root, y_root,
- _posqueue[0]->clientarea.x(), _posqueue[0]->clientarea.y());
- 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()->fire((ButtonData*)data);
- Py_DECREF((PyObject*)data);
-}
-
-void OBActions::mapRequestHandler(const XMapRequestEvent &e)
-{
- doCallback(Action_NewWindow, e.window, (OBWidget::WidgetType)-1,
- 0, 0, 0, 0, 0);
-}
-
-void OBActions::unmapHandler(const XUnmapEvent &e)
-{
- (void)e;
- doCallback(Action_CloseWindow, e.window, (OBWidget::WidgetType)-1,
- 0, 0, 0, 0, 0);
+ 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);