void MediaControlPanelElement::defaultEventHandler(Event* event) { MediaControlDivElement::defaultEventHandler(event); if (event->isMouseEvent()) { LayoutPoint location = static_cast<MouseEvent*>(event)->absoluteLocation(); if (event->type() == eventNames().mousedownEvent && event->target() == this) { startDrag(location); event->setDefaultHandled(); } else if (event->type() == eventNames().mousemoveEvent && m_isBeingDragged) continueDrag(location); else if (event->type() == eventNames().mouseupEvent && m_isBeingDragged) { continueDrag(location); endDrag(); event->setDefaultHandled(); } } }
void DocWindowFrame::onMotionNotifyEvent( xcb_motion_notify_event_t* event) { if(isDragging()){ int32_t x, y; getCurrentDragPos(x, y); drawDragOutline(x, y); continueDrag(event->root_x, event->root_y, x, y); drawDragOutline(x, y); } }