commit 796486a95674beffa5b1ac9f072a11524dca9beb
parent af539d638d26b722ff996b1dcbee60963f0e9f71
Author: Greg Stoll <gstoll@mozilla.com>
Date: Mon, 6 Oct 2025 11:18:30 +0000
Bug 1947324 part 5 - remove assert for unstacked window procs on Windows r=win-reviewers,handyman
Now that we're using the Windows App SDK to remove the minimize/maximize/close
buttons from the toolbar, the Windows App SDK seems to associate its own
window proc with the window, so this assertion was failing. Unstacking it
in this way doesn't seem to cause any issues.
Differential Revision: https://phabricator.services.mozilla.com/D267039
Diffstat:
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp
@@ -1563,7 +1563,12 @@ void nsWindow::DissociateFromNativeWindow() {
DebugOnly<WNDPROC> wndProcBeforeDissociate =
reinterpret_cast<WNDPROC>(::SetWindowLongPtrW(
mWnd, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(*mPrevWndProc)));
- NS_ASSERTION(wndProcBeforeDissociate == nsWindow::WindowProc,
+ // If we've used the Windows App SDK to remove the minimize/maximize/close
+ // entries from the titlebar, then the Windows App SDK sets its own WNDPROC
+ // own the window, so this assertion would fail. But we only do this if
+ // Mica is available.
+ NS_ASSERTION(WinUtils::MicaAvailable() ||
+ wndProcBeforeDissociate == nsWindow::WindowProc,
"Unstacked an unexpected native window procedure");
WinUtils::SetNSWindowPtr(mWnd, nullptr);