diff --git a/src/build_confirmation_gui.cpp b/src/build_confirmation_gui.cpp index c7d82bc2ca..34fe8d95fd 100644 --- a/src/build_confirmation_gui.cpp +++ b/src/build_confirmation_gui.cpp @@ -276,13 +276,14 @@ bool ConfirmationWindowShown() bool BuildConfirmationWindowProcessViewportClick() { if (!BuildConfirmationWindow::shown) return false; - Window *w = FindWindowById(WC_BUILD_CONFIRMATION, 0); if (w != NULL && IsInsideBS(_cursor.pos.x, w->left, w->width) && IsInsideBS(_cursor.pos.y, w->top, w->height)) { - Point pt; - pt.x = _cursor.pos.x - w->left; - pt.y = _cursor.pos.y - w->top; - w->OnClick(pt, WID_BC_OK, 1); + if (_settings_client.gui.windows_titlebars || !_left_button_down) { + Point pt; + pt.x = _cursor.pos.x - w->left; + pt.y = _cursor.pos.y - w->top; + w->OnClick(pt, WID_BC_OK, 1); + } return true; } diff --git a/src/window.cpp b/src/window.cpp index f8ecb966ec..dd63fcafff 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -2587,7 +2587,7 @@ static EventState HandleViewportScroll() if (_left_button_down) { oldDx += _cursor.delta.x; oldDy += _cursor.delta.y; - if (!_left_button_dragged && abs(oldDx) + abs(oldDy) > 20) { + if (!_left_button_dragged && (abs(oldDx) + abs(oldDy)) * 2 > (int)GetMinSizing(NWST_STEP, 10)) { _left_button_dragged = true; } } else { @@ -3080,6 +3080,8 @@ static void MouseLoop(MouseClick click, int mousewheel) if (!_left_button_dragged && mouse_down_on_viewport) { HandleViewportMouseUp(vp, x, y); MoveAllHiddenWindowsBackToScreen(); + } else if (_left_button_dragged && mouse_down_on_viewport) { + BuildConfirmationWindowProcessViewportClick(); } _left_button_dragged = false; mouse_down_on_viewport = false; diff --git a/todo.txt b/todo.txt index 7e4f7c36dc..a14784f8ff 100644 --- a/todo.txt +++ b/todo.txt @@ -17,4 +17,4 @@ - Drag&drop is broken. -- Bridges dialog is broken. +- Cancelling bridge building still sohws the dialog.