From 4aef6bb2857f2f23dc28095a0edb8dd405d927e9 Mon Sep 17 00:00:00 2001 From: "mr. m" Date: Tue, 18 Nov 2025 21:02:28 +0100 Subject: [PATCH 1/4] chore: Bump version, b=no-bug, c=no-component --- surfer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/surfer.json b/surfer.json index 544ec059d..e4e79e6e3 100644 --- a/surfer.json +++ b/surfer.json @@ -19,7 +19,7 @@ "brandShortName": "Zen", "brandFullName": "Zen Browser", "release": { - "displayVersion": "1.17.7b", + "displayVersion": "1.17.8b", "github": { "repo": "zen-browser/desktop" }, From 9f15a61727641e59d645f23d80bef29a14053952 Mon Sep 17 00:00:00 2001 From: "mr. m" <91018726+mr-cheffy@users.noreply.github.com> Date: Tue, 18 Nov 2025 21:02:58 +0100 Subject: [PATCH 2/4] chore: Apply patches from https://bugzilla.mozilla.org/show_bug.cgi?id=1993474, p=#11351 c=no-component --- src/firefox-patches/bug_1993474.patch | 107 ++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 src/firefox-patches/bug_1993474.patch diff --git a/src/firefox-patches/bug_1993474.patch b/src/firefox-patches/bug_1993474.patch new file mode 100644 index 000000000..11ebfc044 --- /dev/null +++ b/src/firefox-patches/bug_1993474.patch @@ -0,0 +1,107 @@ +diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp +index 2a17159215d107f6e4b09cf3a63ab0fff2c2ee70..15dffb83dbac8c6aa9b3dfa388b66874d5b05a7e 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(); +@@ -8792,9 +8811,10 @@ void nsWindow::FrameState::CheckInvariant() const { + mPreFullscreenSizeMode < nsSizeMode_Invalid); + MOZ_ASSERT(mWindow); + +- // We should never observe fullscreen sizemode unless fullscreen is enabled +- MOZ_ASSERT_IF(mSizeMode == nsSizeMode_Fullscreen, mFullscreenMode); +- MOZ_ASSERT_IF(!mFullscreenMode, mSizeMode != nsSizeMode_Fullscreen); ++ // Unfortunately this can happen now with the hack fix in ++ // SetSizeModeInternal() ++ // MOZ_ASSERT_IF(mSizeMode == nsSizeMode_Fullscreen, mFullscreenMode); ++ // MOZ_ASSERT_IF(!mFullscreenMode, mSizeMode != nsSizeMode_Fullscreen); + + // Something went wrong if we somehow saved fullscreen mode when we are + // changing into fullscreen mode +@@ -8902,6 +8922,62 @@ void nsWindow::FrameState::SetSizeModeInternal(nsSizeMode aMode, + mSizeMode == nsSizeMode_Fullscreen || aMode == nsSizeMode_Fullscreen; + const bool maximized = aMode == nsSizeMode_Maximized; + const bool fullscreen = aMode == nsSizeMode_Fullscreen; ++ const bool wasMaximized = mSizeMode == nsSizeMode_Maximized; ++ const bool wasFullscreen = mSizeMode == nsSizeMode_Fullscreen; ++ ++ // Maximizing a window without the WS_BORDER style set will make Windows ++ // display it over the taskbar, even if we tell it not to. So if we're ++ // becoming maximized, make sure WS_BORDER is set, then clear it after a ++ // short time if necessary (to avoid issues like bug 1993474). Conversely, ++ // for becoming fullscreen make sure WS_BORDER is cleared. Yes, this is a ++ // hack. ++ if ((maximized && !wasMaximized) || (fullscreen && !wasFullscreen)) { ++ const LONG_PTR actualStyle = ::GetWindowLongPtrW(mWindow->mWnd, GWL_STYLE); ++ LONG_PTR newStyle = actualStyle; ++ if (maximized) { ++ newStyle |= WS_BORDER; ++ } else { ++ newStyle &= ~WS_BORDER; ++ } ++ if (newStyle != actualStyle) { ++ VERIFY_WINDOW_STYLE(newStyle); ++ MOZ_LOG( ++ gWindowsLog, LogLevel::Info, ++ ("window style is %d, temporarily fixing up WS_BORDER", mSizeMode)); ++ ::SetWindowLongPtrW(mWindow->mWnd, GWL_STYLE, newStyle); ++ ::SetWindowPos(mWindow->mWnd, nullptr, 0, 0, 0, 0, ++ SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | ++ SWP_NOACTIVATE | SWP_NOOWNERZORDER); ++ } ++ NS_DispatchToMainThread(NS_NewRunnableFunction( ++ "nsWindow::FrameState::SetSizeModeInternal", ++ [expectedMode = aMode, window = RefPtr(this->mWindow)]() { ++ // Make sure we're still in the same state (i.e. the user hasn't ++ // un-maximized or un-fullscreened the window in the meantime) ++ if (window->SizeMode() != expectedMode) { ++ return; ++ } ++ const LONG_PTR actualStyle = ++ ::GetWindowLongPtrW(window->mWnd, GWL_STYLE); ++ LONG_PTR newStyle = actualStyle; ++ if (expectedMode == nsSizeMode_Maximized && ++ window->mCustomNonClient) { ++ newStyle &= ~WS_BORDER; ++ } else { ++ newStyle |= WS_BORDER; ++ } ++ if (newStyle != actualStyle) { ++ VERIFY_WINDOW_STYLE(newStyle); ++ MOZ_LOG(gWindowsLog, LogLevel::Info, ++ ("window style is %d, after delay restoring WS_BORDER", ++ expectedMode)); ++ ::SetWindowLongPtrW(window->mWnd, GWL_STYLE, newStyle); ++ ::SetWindowPos(window->mWnd, nullptr, 0, 0, 0, 0, ++ SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | ++ SWP_NOACTIVATE | SWP_NOOWNERZORDER); ++ } ++ })); ++ } + + mSizeMode = aMode; + From b903a25092cae6322625d345726ac4dd05a0d498 Mon Sep 17 00:00:00 2001 From: "mr. m" <91018726+mr-cheffy@users.noreply.github.com> Date: Wed, 19 Nov 2025 01:59:46 +0100 Subject: [PATCH 3/4] chore: Revert "https://github.com/zen-browser/desktop/commit/9f15a61727641e59d645f23d80bef29a14053952", p=#11353 This reverts commit 9f15a61727641e59d645f23d80bef29a14053952. --- src/firefox-patches/bug_1993474.patch | 107 -------------------------- 1 file changed, 107 deletions(-) delete mode 100644 src/firefox-patches/bug_1993474.patch diff --git a/src/firefox-patches/bug_1993474.patch b/src/firefox-patches/bug_1993474.patch deleted file mode 100644 index 11ebfc044..000000000 --- a/src/firefox-patches/bug_1993474.patch +++ /dev/null @@ -1,107 +0,0 @@ -diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp -index 2a17159215d107f6e4b09cf3a63ab0fff2c2ee70..15dffb83dbac8c6aa9b3dfa388b66874d5b05a7e 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(); -@@ -8792,9 +8811,10 @@ void nsWindow::FrameState::CheckInvariant() const { - mPreFullscreenSizeMode < nsSizeMode_Invalid); - MOZ_ASSERT(mWindow); - -- // We should never observe fullscreen sizemode unless fullscreen is enabled -- MOZ_ASSERT_IF(mSizeMode == nsSizeMode_Fullscreen, mFullscreenMode); -- MOZ_ASSERT_IF(!mFullscreenMode, mSizeMode != nsSizeMode_Fullscreen); -+ // Unfortunately this can happen now with the hack fix in -+ // SetSizeModeInternal() -+ // MOZ_ASSERT_IF(mSizeMode == nsSizeMode_Fullscreen, mFullscreenMode); -+ // MOZ_ASSERT_IF(!mFullscreenMode, mSizeMode != nsSizeMode_Fullscreen); - - // Something went wrong if we somehow saved fullscreen mode when we are - // changing into fullscreen mode -@@ -8902,6 +8922,62 @@ void nsWindow::FrameState::SetSizeModeInternal(nsSizeMode aMode, - mSizeMode == nsSizeMode_Fullscreen || aMode == nsSizeMode_Fullscreen; - const bool maximized = aMode == nsSizeMode_Maximized; - const bool fullscreen = aMode == nsSizeMode_Fullscreen; -+ const bool wasMaximized = mSizeMode == nsSizeMode_Maximized; -+ const bool wasFullscreen = mSizeMode == nsSizeMode_Fullscreen; -+ -+ // Maximizing a window without the WS_BORDER style set will make Windows -+ // display it over the taskbar, even if we tell it not to. So if we're -+ // becoming maximized, make sure WS_BORDER is set, then clear it after a -+ // short time if necessary (to avoid issues like bug 1993474). Conversely, -+ // for becoming fullscreen make sure WS_BORDER is cleared. Yes, this is a -+ // hack. -+ if ((maximized && !wasMaximized) || (fullscreen && !wasFullscreen)) { -+ const LONG_PTR actualStyle = ::GetWindowLongPtrW(mWindow->mWnd, GWL_STYLE); -+ LONG_PTR newStyle = actualStyle; -+ if (maximized) { -+ newStyle |= WS_BORDER; -+ } else { -+ newStyle &= ~WS_BORDER; -+ } -+ if (newStyle != actualStyle) { -+ VERIFY_WINDOW_STYLE(newStyle); -+ MOZ_LOG( -+ gWindowsLog, LogLevel::Info, -+ ("window style is %d, temporarily fixing up WS_BORDER", mSizeMode)); -+ ::SetWindowLongPtrW(mWindow->mWnd, GWL_STYLE, newStyle); -+ ::SetWindowPos(mWindow->mWnd, nullptr, 0, 0, 0, 0, -+ SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | -+ SWP_NOACTIVATE | SWP_NOOWNERZORDER); -+ } -+ NS_DispatchToMainThread(NS_NewRunnableFunction( -+ "nsWindow::FrameState::SetSizeModeInternal", -+ [expectedMode = aMode, window = RefPtr(this->mWindow)]() { -+ // Make sure we're still in the same state (i.e. the user hasn't -+ // un-maximized or un-fullscreened the window in the meantime) -+ if (window->SizeMode() != expectedMode) { -+ return; -+ } -+ const LONG_PTR actualStyle = -+ ::GetWindowLongPtrW(window->mWnd, GWL_STYLE); -+ LONG_PTR newStyle = actualStyle; -+ if (expectedMode == nsSizeMode_Maximized && -+ window->mCustomNonClient) { -+ newStyle &= ~WS_BORDER; -+ } else { -+ newStyle |= WS_BORDER; -+ } -+ if (newStyle != actualStyle) { -+ VERIFY_WINDOW_STYLE(newStyle); -+ MOZ_LOG(gWindowsLog, LogLevel::Info, -+ ("window style is %d, after delay restoring WS_BORDER", -+ expectedMode)); -+ ::SetWindowLongPtrW(window->mWnd, GWL_STYLE, newStyle); -+ ::SetWindowPos(window->mWnd, nullptr, 0, 0, 0, 0, -+ SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | -+ SWP_NOACTIVATE | SWP_NOOWNERZORDER); -+ } -+ })); -+ } - - mSizeMode = aMode; - From 4089dfa18baaa724b7a6bfc63b9164164caff83e Mon Sep 17 00:00:00 2001 From: ramiro Date: Wed, 19 Nov 2025 12:30:15 +0100 Subject: [PATCH 4/4] fix: Split view gap when in compact view and sidebar is on right, b=closes https://github.com/zen-browser/desktop/issues/11269, p=#11357 --- src/zen/compact-mode/sidebar.inc.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zen/compact-mode/sidebar.inc.css b/src/zen/compact-mode/sidebar.inc.css index 40fecdf51..30110fd0d 100644 --- a/src/zen/compact-mode/sidebar.inc.css +++ b/src/zen/compact-mode/sidebar.inc.css @@ -106,7 +106,7 @@ right: calc(-1 * var(--actual-zen-sidebar-width) + var(--zen-element-separation) / 2 + 1px); } - & .browserSidebarContainer { + & .browserSidebarContainer:not([is-zen-split='true']) { margin-left: 0 !important; margin-right: 0 !important; }