tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit cccc001d2d31d800a9e6706a1c735fe5a71e229e
parent 26e0f7d2eb66e37066362c08487ca2bc431d23d9
Author: Emilio Cobos Álvarez <emilio@crisal.io>
Date:   Tue,  9 Dec 2025 20:09:30 +0000

Bug 2004597 - Remove unnecessary check in WM_NCLBUTTONDOWN. r=win-reviewers,gstoll

This caught my eye when debugging recent titlebar issues. I agree with
the todo comment.

Differential Revision: https://phabricator.services.mozilla.com/D275374

Diffstat:
Mwidget/windows/nsWindow.cpp | 7+------
1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp @@ -5544,16 +5544,11 @@ bool nsWindow::ProcessMessageInternal(UINT msg, WPARAM& wParam, LPARAM& lParam, break; case WM_NCLBUTTONDOWN: { - // TODO(rkraesig): do we really need this? It should be the same as - // wParam, and when it's not we probably don't want it here. - auto const hitTest = - ClientMarginHitTestPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)); - // Dispatch a custom event when this happens in the draggable region, so // that non-popup-based panels can react to it. This doesn't send an // actual mousedown event because that would break dragging or interfere // with other mousedown handling in the caption area. - if (hitTest == HTCAPTION) { + if (wParam == HTCAPTION) { DispatchCustomEvent(u"draggableregionleftmousedown"_ns); mDraggingWindowWithMouse = true; }