(Newbie) Drag window from client area

I’m trying to get rid of the titlebar, and make the window “dragable” from the client area. I’ve tried the following, but the win gets too much movement info:

void MainContent::mouseDrag (const juce::MouseEvent& mEvent)
int x = mEvent.getMouseDownScreenX() - mEvent.getMouseDownX() + mEvent.getDistanceFromDragStartX();
int y = mEvent.getMouseDownScreenY() - mEvent.getMouseDownY() + mEvent.getDistanceFromDragStartY();

getParentComponent()->setTopLeftPosition(x, y);

Any help?