From 031c8a7f52bbdde1f8db0471900b7805181ae1c5 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Wed, 12 Jan 2022 18:11:27 -0500 Subject: [PATCH] chrome: Fix crashes when toggling full-screen mode (fixes issue #3182) --- patch/patches/chrome_runtime_views.patch | 30 +++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/patch/patches/chrome_runtime_views.patch b/patch/patches/chrome_runtime_views.patch index d7df21f71..03cd7a76d 100644 --- a/patch/patches/chrome_runtime_views.patch +++ b/patch/patches/chrome_runtime_views.patch @@ -129,7 +129,7 @@ index 6a1e9abbc66aa..aa9e3ebe2599c 100644 BrowserFrame(const BrowserFrame&) = delete; BrowserFrame& operator=(const BrowserFrame&) = delete; diff --git chrome/browser/ui/views/frame/browser_view.cc chrome/browser/ui/views/frame/browser_view.cc -index 3c6fcbebb84bb..db469505c4ab2 100644 +index 3c6fcbebb84bb..f2eb23d39e5ee 100644 --- chrome/browser/ui/views/frame/browser_view.cc +++ chrome/browser/ui/views/frame/browser_view.cc @@ -291,11 +291,10 @@ using content::WebContents; @@ -257,6 +257,34 @@ index 3c6fcbebb84bb..db469505c4ab2 100644 using_native_frame_ = frame_->ShouldUseNativeFrame(); MaybeInitializeWebUITabStrip(); +@@ -3755,7 +3777,8 @@ void BrowserView::ProcessFullscreen(bool fullscreen, + // Undo our anti-jankiness hacks and force a re-layout. + in_process_fullscreen_ = false; + ToolbarSizeChanged(false); +- frame_->GetFrameView()->OnFullscreenStateChanged(); ++ if (frame_->GetFrameView()) ++ frame_->GetFrameView()->OnFullscreenStateChanged(); + } + + bool BrowserView::ShouldUseImmersiveFullscreenForUrl(const GURL& url) const { +@@ -4046,6 +4069,8 @@ Profile* BrowserView::GetProfile() { + } + + void BrowserView::UpdateUIForTabFullscreen() { ++ if (!frame_->GetFrameView()) ++ return; + frame()->GetFrameView()->UpdateFullscreenTopUI(); + } + +@@ -4068,6 +4093,8 @@ void BrowserView::HideDownloadShelf() { + } + + bool BrowserView::CanUserExitFullscreen() const { ++ if (!frame_->GetFrameView()) ++ return true; + return frame_->GetFrameView()->CanUserExitFullscreen(); + } + diff --git chrome/browser/ui/views/frame/browser_view.h chrome/browser/ui/views/frame/browser_view.h index 6eea8b4b899e2..4dc56c94baa3f 100644 --- chrome/browser/ui/views/frame/browser_view.h