diff --git a/src/window.cpp b/src/window.cpp index 568b1814b6..caa936cb36 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -1423,6 +1423,30 @@ static void HandlePlacePresize() w->OnPlacePresize(pt, TileVirtXY(pt.x, pt.y)); } +/** + * Handle dragging in mouse dragging mode (#WSM_DRAGDROP). + * @return State of handling the event. + */ +static EventState HandleMouseDrag() +{ + Window *w; + + if (_special_mouse_mode != WSM_DRAGDROP) return ES_NOT_HANDLED; + if (!_left_button_down || (_cursor.delta.x == 0 && _cursor.delta.y == 0)) return ES_NOT_HANDLED; + + w = _thd.GetCallbackWnd(); + + if (w != NULL) { + /* Send an event in client coordinates. */ + Point pt; + pt.x = _cursor.pos.x - w->left; + pt.y = _cursor.pos.y - w->top; + w->OnMouseDrag(pt, GetWidgetFromPos(w, pt.x, pt.y)); + } + + return ES_HANDLED; +} + /** * Handle drop in mouse dragging mode (#WSM_DRAGDROP). * @return State of handling the event. @@ -1447,28 +1471,6 @@ static EventState HandleDragDrop() return ES_HANDLED; } -/** - * Handle dragging in mouse dragging mode (#WSM_DRAGDROP). - * @return State of handling the event. - */ -static EventState HandleMouseDrag() -{ - if (_special_mouse_mode != WSM_DRAGDROP) return ES_NOT_HANDLED; - if (!_left_button_down || (_cursor.delta.x == 0 && _cursor.delta.y == 0)) return ES_NOT_HANDLED; - - Window *w = _thd.GetCallbackWnd(); - - if (w != NULL) { - /* Send an event in client coordinates. */ - Point pt; - pt.x = _cursor.pos.x - w->left; - pt.y = _cursor.pos.y - w->top; - w->OnMouseDrag(pt, GetWidgetFromPos(w, pt.x, pt.y)); - } - - return ES_HANDLED; -} - /** Report position of the mouse to the underlying window. */ static void HandleMouseOver() {