diff --git a/src/firefox-patches/bug_1993474_fix.patch b/src/firefox-patches/bug_1993474_fix.patch new file mode 100644 index 000000000..b18363128 --- /dev/null +++ b/src/firefox-patches/bug_1993474_fix.patch @@ -0,0 +1,30 @@ +diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp +index 2a17159215d107f6e4b09cf3a63ab0fff2c2ee70..622bb36a184a87a1d755b19ff6c3c50027ae53f5 100644 +--- a/widget/windows/nsWindow.cpp ++++ b/widget/windows/nsWindow.cpp +@@ -2848,6 +2848,25 @@ void nsWindow::SetCustomTitlebar(bool aCustomTitlebar) { + + mCustomNonClient = aCustomTitlebar; + ++ // Because of bug 1993474, we want to properly set the WS_BORDER style ++ // when the titlebar is turned on or off. ++ // ++ // The documentation for window styles says that most styles can't be ++ // modified after the window is created. Testing shows that WS_BORDER ++ // seems to be OK, but make sure this is the only style we try to change ++ // here. ++ const LONG_PTR actualStyle = ::GetWindowLongPtrW(mWnd, GWL_STYLE); ++ LONG_PTR newStyle = actualStyle; ++ if (mCustomNonClient) { ++ newStyle &= ~WS_BORDER; ++ } else { ++ newStyle |= WS_BORDER; ++ } ++ if (newStyle != actualStyle) { ++ VERIFY_WINDOW_STYLE(newStyle); ++ ::SetWindowLongPtrW(mWnd, GWL_STYLE, newStyle); ++ } ++ + // Force a reflow of content based on the new client dimensions. + if (mCustomNonClient) { + UpdateNonClientMargins();